- 在路由中配置
{
path: '',
name: 'xx',
meta: { keepAlive: true },
component: xx
},
- 在App.vue中配置
computed: { key() { return this.$route.path + Math.random(); }, },
- 独有的生命周期
//进入时触发
activated() {}
//退出时触发
deactivated() {}
keepAlive还支持很多功能,需要自己去查



