Refactor SearchBar
parent
8da5caa2a3
commit
0c1f7a2527
|
@ -70,16 +70,16 @@ export default {
|
||||||
this.menu = data;
|
this.menu = data;
|
||||||
|
|
||||||
data.forEach((route) => {
|
data.forEach((route) => {
|
||||||
let childRoute = route;
|
let childRoute = {...route};
|
||||||
childRoute = childRoute.children.filter((childRoute) => {
|
childRoute.children = childRoute.children.filter((child) => {
|
||||||
if (childRoute.meta) {
|
if (child.meta) {
|
||||||
this.routes.push(childRoute);
|
this.routes.push(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !childRoute.meta;
|
return !child.meta;
|
||||||
})
|
})
|
||||||
|
|
||||||
this.routes.push(route);
|
this.routes.push(childRoute);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue