網站首頁 學習教育 IT科技 金融知識 旅遊規劃 生活小知識 家鄉美食 養生小知識 健身運動 美容百科 遊戲知識 綜合知識
當前位置:趣知科普吧 > IT科技 > 

vue生命週期函數有哪些

欄目: IT科技 / 發佈於: / 人氣:2.88W
品牌型號:聯想 YOGA 14c/系統版本:windows7

Vue生命週期函數有:beforeCreate、created、beforeMount、mounted、beforeUpdate、updated、beforeDestroy、destroyed、activated、deactivated、errorCaptured。

1、beforeCreate:組件實例剛被創建,組件屬性計算之前。

2、Created:組件實例剛被創建,屬性已綁定,但DOM還未生成。

3、beforeMount:模板編譯/掛載之前。

4、Mounted:模板編譯/掛載之後。

5、beforeUpdate:組件更新之前。

6、Updated:組件更新之後。

7、beforeDestroy:組件銷燬前調用。

8、Destroyed:組件銷燬後調用。

9、activated:組件激活時調用。

10、deactivated:組件停用時調用。

11、errorCaptured:當捕獲一個來自子孫組件的錯誤時被調用。

vue生命週期函數有哪些

web自學教程)