## 生命周期鉤子
生命周期函數就是VUE實例在某一個事件點會自動執行的函數. 實際上有11個聲明周期函數.
```
var vm = new Vue({
el: '#app',
//初始化事件和生命周期結束后
beforeCreate: function () {
console.log('beforeCreate');
},
//外部注入和雙向綁定后
created: function () {
console.log('created');
},
//初始化完成后查找是否有el掛載點
//查找是否有template,有就用template,如果沒有,就把el外部的元素當做模板
beforeMount: function () {
console.log('beforeMount'); //此時元素還沒有被渲染到頁面上
},
//模板結合數據生成的VUE的DOM元素就被顯示在頁面上
mounted: function () {
console.log('mounted');
},
//vm.$destroy被調用才會執行下面的函數
beforeDestroy: function () {
console.log('beforeDestroy');
},
destroyed: function () {
console.log('destroy');
},
//數據被改變,還沒渲染之前執行
beforeUpdate: function () {
console.log('beforeUpdate');
},
//數據更改后,渲染后執行
updated: function () {
console.log('updated');
},
});
```
## 圖示

- 基礎
- MVVM
- 前端組件化
- VUE實例
- 生命周期
- 指令
- v-bind
- 模板語法
- 使用樣式
- class樣式
- 內聯樣式
- v-for
- v-if和v-show
- 過濾器
- 計算屬性
- 方法偵聽器
- 計算屬性的set和get
- watch,computed,methods對比
- 樣式綁定
- 條件渲染
- 組件
- 組件化和模塊化區別
- 使用組件的細節
- 父子組件數據傳遞
- 組件參數校驗與非props特性
- 給組件綁定原生事件
- 非父子組件間的傳值
- 在vue中使用插槽
- 作用域插槽
- 動態組件與v-once指令
- 動畫特效
- vue中CSS動畫原理
- 使用animate
- 同時使用過度和動畫
- JS動畫與velocity的結合
- 多個元素或組件的過度
- vue列表過度
- 動畫封裝
- 路由
- 什么是路由
- VUEX
- 概述
- 安裝
- 訪問倉庫