vue的生命週期
雙向綁定
vue父子組件傳遞參數
this.$children[index]屬性也可以獲取子組件。
https://www.cnblogs.com/xumqfaith/p/7743387.html
曾經的筆記
兄弟組件間特殊的傳值方法暫且瞭解
vue路由
自定義指令
vue router
computed
有每個對象get和set兩個函數,默認爲get
個人理解,set在直接修改computed對象時起作用,它決定如何處理新的數據,若set不再修改get中的數據,則只會調用set,也不會調用update
<input type="text" v-model="fullName">
<input type="text" v-model="firstName">
<input type="text" v-model="lastName">
computed: {
fullName: {
//getter 方法
get(){
console.log('computed getter...')
return this.firstName + ' ' + this.lastName
},
//setter 方法
set(newValue){
console.log('computed setter...')
var names = newValue.split(' ')
this.firstName = names[0]
this.lastName = names[names.length - 1]
return this.firstName + ' ' + this.lastName
}
}