[new feature] Tabbar: support match route by to.name (#4148)

This commit is contained in:
neverland
2019-08-19 11:27:05 +08:00
committed by GitHub
parent 4e828fbc70
commit 643003b43c
3 changed files with 78 additions and 2 deletions

View File

@@ -27,8 +27,8 @@ export default createComponent({
routeActive() {
const { to, $route } = this;
if (to && $route) {
const path = isObj(to) ? to.path : to;
return $route.path === path;
const config = isObj(to) ? to : { path: to };
return config.path === $route.path || config.name === $route.name;
}
}
},