黑馬vue---21-22、總結
一、總結
一句話總結:
· 在 VM 實例中,如果要訪問 data 上的數據,或者要訪問 methods 中的方法, 必須帶 this
· 在 v-for 要會使用 key 屬性 (只接受 string / number)
· v-model 只能應用於表單元素
· 在vue中綁定樣式兩種方式 v-bind:class v-bind:style
二、內容在總結中
<!-- 1. MVC 和 MVVM 的區別 --> <!-- 2. 學習了Vue中最基本代碼的結構 --> <!-- 3. 插值表達式 v-cloak v-text v-html v-bind(縮寫是:) v-on(縮寫是@) v-model v-for v-if v-show --> <!-- 4. 事件修飾符 : .stop .prevent .capture .self .once --> <!-- 5. el 指定要控制的區域 data 是個對象,指定了控制的區域內要用到的數據 methods 雖然帶個s后綴,但是是個對象,這里可以自定義了方法 --> <!-- 6. 在 VM 實例中,如果要訪問 data 上的數據,或者要訪問 methods 中的方法, 必須帶 this --> <!-- 7. 在 v-for 要會使用 key 屬性 (只接受 string / number) --> <!-- 8. v-model 只能應用於表單元素 --> <!-- 9. 在vue中綁定樣式兩種方式 v-bind:class v-bind:style -->