-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
keep-alive activated and deactivated hooks should trigger recursively when toggled #4242
Comments
Please be more specific on why you think it should work like that, and what use case are you running into that needs this. A single title doesn't qualify as a feature request. |
很抱歉没有做更详细的说明,我们项目中的页面级组件都会带有设置页面meta属性的参数,当页面跳转时会自动设置这些属性,很自然他们是由activated/created来触发的,而在部分嵌套页面里,这个功能失效了,于是我们发现了这个问题。 |
I have the same issue. Activated/Deactivated are called only on the components registered by router. So children of these components cannot benefit from activated/deactivated lifecycle hooks. Do you think this will be in next releases? |
同样的困惑,假如A跟B两个组件都有keep-alive。他们有共同的组件C,那么A初始化的时候C会执行一次create,B初始化的时候C同样会执行一次create。这时返回A,页面上的C组件不会触发任何生命周期的事件...假如C有个prop,A跟B都有传递,用watch监听这个prop也不会触发事件 |
@kinglion keep-alive的子组件目前不触发生命周期事件钩子,需要手动调用,调用方法参考callHook 方法 |
@nothinggift 嗯,这个也是一个hack方法 😊 |
这个就太麻烦的,我的页面现在全都是keep-alive的,每个页面根元素是个自己封装的组件,里面加了一些回调,比如动画结束之类的回调事件,如果需要手动去触发子组件的钩子,每个页面都得在activated函数里callHook,这个应该能在每个组件中配置是否触发子组件的钩子 |
我也遇到这个问题,谁有解决办法??请告诉我,thank you |
you can remove it. |
@aierui How to remove it? |
我的第三级路由组件 ,只能触发deactivated函数, activated不能触发,很奇怪啊,二级路由就都可以触发,下面是子路由插座的写法
|
也遇到同样的问题,路由对应的入口组件里边的activated,deactivated钩子触发了,但是入口组件里边引用的子组件的deactivated,activated钩子都没有被触发 |
No description provided.
The text was updated successfully, but these errors were encountered: