Vue 路由 两个生命周期钩子activated deactivated

1、作用

路由独有的两个生命周期函数,用于捕获路由组件的激活状态,激活路由调用

2、功能, 只有 组件被 keep-alive 包裹时才能生效

activated路由组件被激活时调用

activated(){}

deactivated路由组件失活时调用

deactivated(){}

posted @ 2025-01-08 19:59  市丸银  阅读(25)  评论(0)    收藏  举报