vue3生命周期
2024-08-141、setup() : 开始创建组件之前,在 beforecreate 和 created 之前执行,创建的是 data 和 method。8、onActivated(): 被包含在 中的组件,会多出两个生命周期钩子函数,被激活时执行;9、onDeactivated(): 比如从 A 组件,切换到 B 组件,A 组件消失时执行;6、onBeforeUnmount(): 组件卸载之前执行的函数;4、onBeforeUpdate(): 组件更新之前执行的函数;_vue3生命周期详细
2023年Vue2前端面试题(全面)
2024-04-20v-show通过css display控制显示和隐藏,v-if组件真正的渲染和销毁,而不是显示和隐藏,频繁切换状态使用v-show ,否则使用v-if快速查找到节点,减少渲染次数,提升渲染性能单组件生命周期: 挂载:beforecreate==>created==>beforeMount==>mounted 更新:beforeUpdate==>updated 销毁:beforeDestory==>destoryed父子组件生命周期: 挂载:parent_vue2面试题2023