Comments (12)
使用自定义key规则,规则如下:/:linkCode/xxxx/xxxx,此linkCode为动态生成,即所有linkCode下的页面都在同一个tab中打开。
没明白,可以提供完整的 meta
配置吗?
另外,这个是配置在 页面 还是 路由 中?
from vue-router-tab.
RouterTab 一个页签只会有一个缓存,如果多个路由公用一个页签,只会缓存最后一个,并不会缓存每个路由
from vue-router-tab.
RouterTab 一个页签只会有一个缓存,如果多个路由公用一个页签,只会缓存最后一个,并不会缓存每个路由
恩,我看了一下源代码,你是把key值和缓存的key是同一个。我现在自己处理了一下代码,自己管理缓存。
from vue-router-tab.
那我先发布版本修复上一个问题吧。
这个是方案设计如此,应该不算问题
from vue-router-tab.
from vue-router-tab.
对的,目前页签和组件缓存是共用一个 key 的,单个页签最多只维护一个缓存。
你这种场景更建议同一个路由用多页签多缓存,切换也更容易更直观。
同一个页签内部再维护多份缓存,操作上其实也很不直观的,用户如果不关闭也会占用更多内存。
reuse
组件复用,是同一个路由不同参数切换后不销毁,复用之前的组件实例。
如果想用这个实现的话,需要你自己处理数据缓存,路由参数切换后还原数据。
from vue-router-tab.
from vue-router-tab.
reuse 的前提是,路由使用的组件是同一个。如果不是的话是不会共用的
from vue-router-tab.
恩,能确定是同一个组件 ,但是query值 不一样,我之前是发现在query值在一致的时候,缓存是生效的,但query值不一致的时候,缓存不生效。比如/aaaa/bbb和/aaaa/bbb?id=1,这两个地址,组件是同一个,但是就是缓存不生效。
在测试的时候,发现,如果跳出之前是/aaaa/bbb,跳回的时候也是/aaaa/bbb,走的是actived。但如果跳回的时候加了query,如:/aaaa/bbb?id=1,那么就会走mounted。
from vue-router-tab.
路由页签相关配置发一下我看看
from vue-router-tab.
- 开发人员还是使用原始的地址.
- 在beforeRouteLeave里面判断地址中有没有linkCode。没有的话就读取保存的linkCode,并加到地址上,再next,用来确保是在同一个tab中显示。
- 如果加上后还是没有匹配的就跳到404页面。
from vue-router-tab.
我大约知道是什么原因,仔细看了一下代码,你那边即使设置了reuse,实际判断缓存的时候用的是fullpath。而我要实现的东西其实是要按path来判断才会是正确的。所以。。。。
from vue-router-tab.
Related Issues (20)
- 更新到最新版本后关闭按钮无效,提示Cannot read property 'key' of undefined HOT 19
- Change default rule HOT 1
- vue-router-tab 1.2.7版本beforePageLeave Bug HOT 1
- iframe页签切换,每次会有1个被取消的静态资源请求 HOT 3
- 如果页面组件中含有iframe元素则在tab切换时dom结构会改变 HOT 4
- [Question] Order of closing tabs HOT 1
- TabScroll.vue报空错误 HOT 2
- 当预设tab和iframe同时存在时,使用浏览器刷新会出现ID不正确的情况 HOT 1
- 控制台一直报router-link的tag prop警告 HOT 1
- Changing 'routeTab' of inactive tab causes activeTab to change HOT 3
- 当 this.$vnode.data.key 不存在时,动态页签无法更新 HOT 5
- vue 3 version? HOT 4
- 请求支持 tab 数量的限制 HOT 1
- 1.2.9之后渲染不出tab页签 HOT 4
- 当前页签在iframe页签时,再切换到非iframe页签的时候会出现问题 HOT 1
- 页签缓存下,关闭打开的多页签,关闭后显示的其他页签展示的数据为关闭的页签数据
- 点击关闭能否回到最近访问那个页签
- 页面复杂时打开过多的页签,点关闭其他时会卡几秒 HOT 1
- 页签内路由跳转问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-router-tab.