From 0c1f7a2527c7b1464747ff7b2b294f3626956d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20FINDIKLI?= Date: Thu, 18 Feb 2021 12:21:13 +0300 Subject: [PATCH] Refactor SearchBar --- src/AppMenu.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/AppMenu.vue b/src/AppMenu.vue index eb86b0cb0..158190a52 100755 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -70,16 +70,16 @@ export default { this.menu = data; data.forEach((route) => { - let childRoute = route; - childRoute = childRoute.children.filter((childRoute) => { - if (childRoute.meta) { - this.routes.push(childRoute); + let childRoute = {...route}; + childRoute.children = childRoute.children.filter((child) => { + if (child.meta) { + this.routes.push(child); } - return !childRoute.meta; + return !child.meta; }) - this.routes.push(route); + this.routes.push(childRoute); }); }) },