vue生命週期有幾個
- IT科技
- 關注:2.6W次
品牌型號:聯想 YOGA 14c/系統版本:windows7
Vue生命週期共有8個階段,分別為:beforeCreate、created、beforeMount、mounted、beforeUpdate、updated、beforeDestroy、destroyed。
1、beforeCreate:元件例項剛被建立,元件屬性計算之前。
2、Created:元件例項剛被建立,屬性已繫結,但DOM還未生成。
3、beforeMount:模板編譯/掛載之前。
4、Mounted:模板編譯/掛載之後。
5、beforeUpdate:元件更新之前。
6、Updated:元件更新之後。
7、beforeDestroy:元件銷燬前呼叫。
8、Destroyed:元件銷燬後呼叫。
- 文章版權屬於文章作者所有,轉載請註明 https://shqsg.com/dianzi/69l3yy.html