说一下keep-alive 的关联生命周期
发布时间:2022-09-30 15:28:00
发布人:qyf

会比平常的组件多两个生命周期钩子函数,分别是:activated 和 deactivated。
使用 keep-alive包裹的组件在切换时不会被销毁,而是缓存到内存中并执行 deactivated 钩子函数,再次渲染后会执行 activated 钩子函数。