2.vueライフサイクルフック

781 ワード

vue2.0ライフサイクル図の詳細
ライフサイクルとは
Vue            ,        、     、    、  Dom、  →  → 
 、        ,     Vue     。     Vue           ,     
 。

        created     mounted       

  1>.new Vue()  Vue  

  2>.beforeCreate() -----  vue        ,(      loading   ) 

  3>.created() -----             ,(    loading,       ,        )

  4>.beforeMount() -----          html              ,          html      

  5>.mounted() -----      html               ,        ajax    
     ,       。  :mounted()             

  6>.beforeUpdated() -----       ,     DOM          。

  7>.update() -----    ,    DOM       。       ,DOM       ,             DOM  。

  8>.beforeDestory() -----             

  14>.destoryed() ----- Vue     ,  。(        ,      )