<transition name="fade" mode="out-in"><keep-alive><router-view :key="key"></router-view></keep-alive>
</transition>
key() {//实现路由缓存(由route.js中keepAlive动态控制)if (this.$route.meta.keepAlive != undefined) {if (this.$route.meta.keepAlive) {return this.$route.fullPath;}} else {return this.$route.path + new Date()}}
router.js
{path: 'attribute',component: _import('pdm/setting/attribute/index'),name: '属性管理',meta: {keepAlive: true,title: '属性管理'}},