-
創建Info主鍵文件 <router-link?to="/Info">Info</router-link>鏈接主鍵 在router里面定義Info
查看全部 -
組件狀態管理:vuex
多組件混合使用,多頁面,復雜業務(vue-router)
組件間的傳參、消息、事件管理(props,emit/on,bus)
查看全部 -
列表渲染: v-for
查看全部 -
v-bind:綁定屬性 v-on:綁定事件 條件渲染: 1.v-if: <div?v-if="count?>?0"> ????count大于0,count的值是:{{count}} </div> <div?v-else> ????count的值是:{{count}} </div>
查看全部 -
接上一節課代碼
計算屬性(數據聯動,可以監聽很多變量):
computed{ ????message1:?function(){ ????????return?'computed:'?+?this.meg ????}
偵聽器:
watch:{ ??message:?function?(newval.oldval)?{ ???????console.log('newval?is:'+newval)
???????console.log('oldval?is:'+oldval) ??}
console.logo在調試窗口打印值,在console打開窗口,輸入app/message = 'computed value',則會輸出:
newval is: computed value
oldval is: hello vue!
頁面輸出(異步場景,只能監聽一個變量或者數組):
computed value
computed: computed value
查看全部 -
v-on? @
v-bind? :
查看全部 -
Vue2.x
查看全部 -
Vue2.x
查看全部 -
Vue開發環境
查看全部 -
Vue2.x
查看全部 -
Vue2.x
查看全部 -
watch (異步場景),computed(數據聯動)
查看全部 -
開發環境!
查看全部
舉報
0/150
提交
取消