vue 的生命週期實例

1、在test.vue文件內寫好dom結構; 2、在script標籤內寫好beforeCreate(創建前),created(創建後),beforeMount(載入前),mounted(載入後),beforeUpdate(更新前),updated(更新後),beforeDestroy(銷燬前),destroyed(銷燬後); 3、在methods裏寫好change方法。 4、刷新頁面,執行結果如下
相關文章
相關標籤/搜索