feat:keep-alive

master
ewall 5 years ago
parent cd551a1713
commit d005ff5282

@ -18,7 +18,7 @@ export default {
},
computed: {
key() {
return this.$route.path
return this.$route.fullPath
}
}
}

@ -21,7 +21,10 @@ export default {
methods: {
onNavigate() {
this.$router.push({
path: '/detail'
path: '/detail',
query: {
t: +new Date()
}
})
}
}

@ -30,7 +30,10 @@ export default {
methods: {
onClick() {
this.$router.push({
path: '/detail'
path: '/detail',
query: {
t: +new Date()
}
})
}
}

@ -44,7 +44,10 @@ export default {
methods: {
onClick() {
this.$router.push({
path: '/product'
path: '/product',
query: {
t: +new Date()
}
})
}
}

@ -12,7 +12,8 @@ const routes = [
// webpackPreloadhttps://www.jianshu.com/p/bbdcfeee7fbc
component: () => import(/* webpackPreload: true */ '@/views/home'),
meta: {
showTab: true
showTab: true,
keepAlive: true
}
},
// 登录
@ -49,13 +50,19 @@ const routes = [
{
path: '/product',
name: 'Product',
component: () => import('@/views/product')
component: () => import('@/views/product'),
meta: {
keepAlive: true
}
},
// 商品详情
{
path: '/detail',
name: 'Detail',
component: () => import('@/views/detail')
component: () => import('@/views/detail'),
meta: {
keepAlive: true
}
},
// 地址管理
{

Loading…
Cancel
Save