Vue Component Props

prop 是父傳子的單向下行綁定(one-way-down binding)
父組件通過 props 把資料傳給子組件,子組件則需要聲明 props 接收。

Vue Component Registration

組件名稱

每個組件都會有個名稱,位置放在第一個參數。

1
Vue.component('my-component-name', { /* ... */ })

Vue Two-way Data Bindings

Vue 的雙向綁定使用的指令是 v-model。
雙向綁定指的是對綁定的操作除了 view model 至 view 以外,還能夠把在 view 上更新的資料傳回 view model。
先前學習的綁定(v-bind、鬍子語法等),皆是僅有從 view model 至 view 的單向綁定。

Vue Event Handling

事件監聽

使用 v-on 指令監聽 DOM 事件。

Vue List Rendering

Vue 的列表渲染,使用的指令是 v-for。

Vue Conditional Rendering

這次來介紹 Vue 的條件性渲染,主要的指令有 v-if 和 v-show。

Vue Computed Properties

模板內的表達式做不到的就交給計算屬性吧。
也就是說,任何複雜的邏輯都應該交給計算屬性。

Vue Class and Style Bindings

class 與 style 皆是屬性,在 HTML 屬性裡帶入資料,用的是 v-bind 語法。
通常來說 v-bind 的屬性值為字串,為了操作的方便,Vue 另外增強了 class 與 style 綁定的功能。

Vue Template_Syntax - basic

模板語法-基礎篇

Vue Lifecycle

Vue 實體在被創建時會經過一系列初始化的步驟,如數據監聽、編譯模板、掛載實體、綁定資料等。與此同時 Vue 也提供了讓使用者能在特定階段自行客製化程式碼的方法,這些方法就稱為 Lifecycle Hook。

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×