[vue] 跟keep-alive有关的生命周期是哪些?描述下这些生命周期
activated和deactivated
activated和deactivated两个生命周期函数 当keep-alive组件激活时,触发activated,keep-alive组件停用时调用deactivated
Most helpful comment
activated和deactivated
1.activated: 页面第一次进入的时候,钩子触发的顺序是created->mounted->activated
2.deactivated: 页面退出的时候会触发deactivated,当再次前进或者后退的时候只触发activated