vue 生命周期-activated
当组件激活时调用的生命周期钩子函数
activated生命周期函数,是配合 keep-alive 进行使用或者路由跳转。进入页面时,mounted 与 activated 生命周期函数都会执行,当前 keep-alive 时或者路由跳转,进行了缓存,这时返回上一页 ,mounted生命周期函数不会执行,而 activated 会执行。
除了触发条件不同,其他使用方法与created与mounted相同。
海之光的个人博客activated生命周期函数,是配合 keep-alive 进行使用或者路由跳转。进入页面时,mounted 与 activated 生命周期函数都会执行,当前 keep-alive 时或者路由跳转,进行了缓存,这时返回上一页 ,mounted生命周期函数不会执行,而 activated 会执行。
除了触发条件不同,其他使用方法与created与mounted相同。