1.beforeCreate: 創(chuàng)建了Vue組件實(shí)例,但是組件屬性還未初始化。比如,data, elt等為undefined。
2.created: 初始化數(shù)據(jù)對(duì)象和事件,例如:可以訪問屬性this.$data。這時(shí)最適合做ajax請(qǐng)求,初始化需要渲染的數(shù)據(jù)。
3.beforeMount: 進(jìn)行模板編譯,但是,模板內(nèi)容還未插入頁面DOM中。
4.mouted: 將生成好的的模板掛載在DOM樹上,并且,組件屬性this.$el被賦值
5.beforeUpdate: 組件更新之前
6.updated: 組件更新之后
7.beforeDestory: 組件銷毀之前,這時(shí),已經(jīng)調(diào)用this.$destory()
8.destoryed: 組件銷毀完畢。這時(shí),組件上的watcher,子組件和事件監(jiān)聽都會(huì)被銷毀
