feat(Tabbar): #9173 support highlighted with child route (#9921)

This commit is contained in:
chenjiangui
2021-11-24 09:51:32 +08:00
committed by GitHub
parent 102a3e4b4e
commit 8dfe31c7a2

View File

@@ -36,10 +36,11 @@ export default createComponent({
const { to, $route } = this;
if (to && $route) {
const config = isObject(to) ? to : { path: to };
const pathMatched = config.path === $route.path;
const nameMatched = isDef(config.name) && config.name === $route.name;
return pathMatched || nameMatched;
return !!$route.matched.find(r =>{
const pathMatched = config.path === r.path;
const nameMatched = isDef(config.name) && config.name === r.name;
return pathMatched || nameMatched;
})
}
},
active() {