mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
parent
102a3e4b4e
commit
8dfe31c7a2
@ -36,10 +36,11 @@ export default createComponent({
|
|||||||
const { to, $route } = this;
|
const { to, $route } = this;
|
||||||
if (to && $route) {
|
if (to && $route) {
|
||||||
const config = isObject(to) ? to : { path: to };
|
const config = isObject(to) ? to : { path: to };
|
||||||
const pathMatched = config.path === $route.path;
|
return !!$route.matched.find(r =>{
|
||||||
const nameMatched = isDef(config.name) && config.name === $route.name;
|
const pathMatched = config.path === r.path;
|
||||||
|
const nameMatched = isDef(config.name) && config.name === r.name;
|
||||||
return pathMatched || nameMatched;
|
return pathMatched || nameMatched;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
active() {
|
active() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user