From 3ca51f90e40947c0e296ddb8277822dbc1dd3831 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 15 Mar 2019 13:36:32 +0800 Subject: [PATCH] change name --- src/components/HeaderSearch/index.vue | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue index 3f6a2fd1..678a218c 100644 --- a/src/components/HeaderSearch/index.vue +++ b/src/components/HeaderSearch/index.vue @@ -33,7 +33,7 @@ export default { } }, computed: { - routers() { + routes() { return this.$store.getters.permission_routes }, lang() { @@ -42,10 +42,10 @@ export default { }, watch: { lang() { - this.searchPool = this.generateRouters(this.routers) + this.searchPool = this.generateRoutes(this.routes) }, - routers() { - this.searchPool = this.generateRouters(this.routers) + routes() { + this.searchPool = this.generateRoutes(this.routes) }, searchPool(list) { this.initFuse(list) @@ -59,7 +59,7 @@ export default { } }, mounted() { - this.searchPool = this.generateRouters(this.routers) + this.searchPool = this.generateRoutes(this.routes) }, methods: { click() { @@ -100,10 +100,10 @@ export default { }, // Filter out the routes that can be displayed in the sidebar // And generate the internationalized title - generateRouters(routers, basePath = '/', prefixTitle = []) { + generateRoutes(routes, basePath = '/', prefixTitle = []) { let res = [] - for (const router of routers) { + for (const router of routes) { // skip hidden router if (router.hidden) { continue } @@ -125,11 +125,11 @@ export default { } } - // recursive child routers + // recursive child routes if (router.children) { - const tempRouters = this.generateRouters(router.children, data.path, data.title) - if (tempRouters.length >= 1) { - res = [...res, ...tempRouters] + const tempRoutes = this.generateRoutes(router.children, data.path, data.title) + if (tempRoutes.length >= 1) { + res = [...res, ...tempRoutes] } } }