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

设置不缓存的子路由也进行缓存了 #22

Open
smalt762581 opened this issue Jul 26, 2022 · 1 comment
Open

设置不缓存的子路由也进行缓存了 #22

smalt762581 opened this issue Jul 26, 2022 · 1 comment

Comments

@smalt762581
Copy link

smalt762581 commented Jul 26, 2022

路由 /a/b/c --> /a/m/n

根路由

   <feb-alive>
     <router-view />
   </feb-alive>

二级路由

    <feb-alive>
      <router-view /> 
    </feb-alive>

如果/a/b/c路由不需要缓存 全部设置禁止缓存
由于渲染父组件的时候不会走到
https://github.com/wefront/feb-alive/blob/master/src/components/feb-alive.js#L101

那么如果b下边的子路由不包裹<feb-alive>不走render这个判断 可能复用了已缓存的父路由中的c组件导致渲染没有刷新

所以请问是不是全局路由都需要包裹<feb-alive> 否则有可能导致子路由渲染的不是最新的

@hangaoke1
Copy link
Collaborator

是的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants