diff --git a/src/App.vue b/src/App.vue index a612a21..d4e84ac 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,8 +1,9 @@ @@ -10,24 +11,11 @@ export default { name:'APP', - provide(){ //父组件中通过provide来提供变量,在子组件中通过inject来注入变量。 - return{ - reload:this.reload - } - }, data(){ return{ - isRouterAlive:true + } }, - methods: { - reload () { - this.isRouterAlive = false; //先关闭, - this.$nextTick(function () { - this.isRouterAlive = true; //再打开 - }) - } - } }; diff --git a/src/router/index.js b/src/router/index.js index 1fa032a..f5b014f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -31,6 +31,9 @@ const routes = [{ path: "/home", name: 'home', component: () => import('../views/Home/index.vue'), + meta: { + keepAlive: true + } }, { path: "/cityDistribution", @@ -51,9 +54,6 @@ const routes = [{ path: "/teamList", name: 'teamList', component: () => import('../views/teamList/index.vue'), - meta: { - // title: '列表' - } }, { path: "/teamPerformance", diff --git a/src/views/Home/index.vue b/src/views/Home/index.vue index c83b3f8..9b4bd98 100644 --- a/src/views/Home/index.vue +++ b/src/views/Home/index.vue @@ -1,7 +1,7 @@