如何制作一个论坛网站,高端网站设计合肥网站建设,电子网站开发,义乌网站建设多少钱需求需要缓存这个出入记录#xff0c;当tab切换时不重新加载#xff0c;当刷新页面时#xff0c;或把这个关闭在重新打开时重新加载如图#xff1a; #xff08;我这里用的是芋道源码的前端框架)
keep-alive
1、include 包含页面组件name的这些组件页面#xff0c;会被…需求需要缓存这个出入记录当tab切换时不重新加载当刷新页面时或把这个关闭在重新打开时重新加载如图 我这里用的是芋道源码的前端框架)
keep-alive
1、include 包含页面组件name的这些组件页面会被缓存起来 2、exclude 除了这些name以外的页面组件会被缓存起来 3、没有include或者exclude属性表示所有的路由组件都会被缓存起来 templatesection classapp-maintransition namefade-transform modeout-inkeep-alive :includecachedViews excluderedirectrouter-view :keykey //keep-alive/transition/section
/templatescript
export default {name: AppMain,computed: {cachedViews() {return this.$store.state.tagsView.cachedViews},key() {return this.$route.path}}
}
/script
解决方法
现在router里面的index.js里面把这三个路由写出来 然后在仓库里面手动把二级路由加上 这样就可以了