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

[vue] 跟keep-alive有关的生命周期是哪些?描述下这些生命周期 #551

Open
haizhilin2013 opened this issue Jul 2, 2019 · 4 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] 跟keep-alive有关的生命周期是哪些?描述下这些生命周期

@haizhilin2013 haizhilin2013 added the vue vue label Jul 2, 2019
@heny
Copy link

heny commented Jul 5, 2019

activated和deactivated两个生命周期函数
当keep-alive组件激活时,触发activated,keep-alive组件停用时调用deactivated

@encountermm
Copy link

activated和deactivated

  • keep-alive的生命周期
    1.activated: 页面第一次进入的时候,钩子触发的顺序是created->mounted->activated
    2.deactivated: 页面退出的时候会触发deactivated,当再次前进或者后退的时候只触发activated

@crush2020
Copy link

crush2020 commented Jan 25, 2021

当组件在 内被切换,它的 activated 和 deactivated 这两个生命周期钩子函数将会被对应执行。被 keep-alive 缓存的组件激活时activated调用。被 keep-alive 缓存的组件停用时deactivated调用。

@igauch
Copy link

igauch commented Jun 17, 2021

activated和deactivated

  • keep-alive的生命周期
    1.activated: 页面第一次进入的时候,钩子触发的顺序是created->mounted->activated
    2.deactivated: 页面退出的时候会触发deactivated,当再次前进或者后退的时候只触发activated

当再次前进或者后退的时候也会触发deactivated吧

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

No branches or pull requests

5 participants