流浪のwolf

卷帝

导航

Vue3的生命周期函数

 
 
选项式 API 组合式API
beforeCreate 不需要  
created  不需要
beforeMount onBeforeMount
mounted onMounted
beforeUpdate onBeforeUpdate
updated onUpdated
beforeUnmount 【vue2.x中的beforeDestory】 onBeforeUnmount
unmounted 【vue2.x中的destoryed】 onUnmounted
activated onActivated
deactivated onDeactivated
ps:选项式API 在export default 直接使用 ,组合式API 在 setup  属性里面使用,& 组合式API 必须import 导入  ;

posted on 2022-11-11 14:31  流浪のwolf  阅读(16)  评论(0编辑  收藏  举报