Skip to content
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

当预设tab和iframe同时存在时,使用浏览器刷新会出现ID不正确的情况 #133

Open
jktantan opened this issue Nov 25, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@jktantan
Copy link

Bug 描述

当设置了预设tab,且打开了一个iframe的tab,并且iframe的tab处理激活状态,点击浏览器的刷新按钮刷新,等待页面加载完后再点击预设tab,会出弹出一个新的预设tab。

问题重现

重现行为的步骤:

  1. 在配置中设置一个预设tab
  2. 打开一个irame的tab,并使iframe处于激活状态。
  3. 点击浏览器的刷新按钮刷新页面,等待页面加载完成。
  4. 再切换到预设tab,此时会打开一个新的预设tab.

附加内容

从代码上来看,tab的key值使用的是自定义方式处理,而iframe的key值是一个固定写法,与其他tab的key生成方式不一样。当iframe页面在激活状态的情况下刷新。重加载预设tab时所获取到的key与实际预设页面上写的key获取方式不一致,导致刷新完成后切换预设tab时会以正确的key值再生成一个新的tab。

@jktantan jktantan added the bug Something isn't working label Nov 25, 2021
@bhuh12
Copy link
Owner

bhuh12 commented Dec 9, 2021

暂时未找到你说的场景,在下面的地址能重现吗?

https://bhuh12.gitee.io/vue-router-tab/demo/#/initial-tabs/iframe/https%3A%2F%2Fcn.vuejs.org/Vue.js/rt-icon-web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants