-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
3级路由缓存问题 #3116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3级路由缓存问题 #3116
Conversation
fix win7 win10 path
merge base
merge from origin master
merge from panjiachen
Deploy preview for vue-element-admin processing. Building with commit be527bc https://app.netlify.com/sites/vue-element-admin/deploys/5ecb8c4ad9d3d80008f50862 |
@dingangang 按照你的方法,三级路由缓存了,但是点击刷新,清除不了缓存 大佬能帮忙看看 |
|
merge master
tagsView.js addCachedView({ commit }, view) { delCachedView({ commit, state }, view) { 修改这两个方法可以解决。但是我感觉解决方法有点取巧了。你可以在项目里试试。 |
Revert "merge master"
点击刷新一个页面后,其他相同层级的三级菜单也会一起被刷新了 |
根本原因: 3级路由根文件的name不会被添加到state.tagsView.cachedViews中。
解决方法:在3级路由根页面即本例的\nested\menu1\index.vue中的created方法内,将根页面的名称加入到state.tagsView.cachedViews(组件的name需要和路由的name保持一致)。这样3级路由页面就可以进行缓存,并且更深层级如menu1-2-1也可以进行缓存。
仅提供了一个思路,如果有更好的方法解决是最好了。