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

Created on 2 Jul 2019  ·  2Comments  ·  Source: haizlin/fe-interview

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

vue

Most helpful comment

activated和deactivated

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

All 2 comments

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

activated和deactivated

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