vux checklist 仿寫總結


基於vux0.1.3

1 <label>

1.1 <label>+<input>

點擊lable標簽時,瀏覽器會自動聚焦到和lable相關的表單控件上去。

1.2 for屬性

"for" 屬性可把 label 綁定到另外一個元素。"for" 屬性的值為相關元素的 id值。

2 filter

對傳入的值進行過濾

filters: {
getValue,
getKey
}
 
export const getValue = function (item) {
return typeof item === 'object' ? item.value : item
}

export const getKey = function (item) {
return typeof item === 'object' ? item.key : item
}

3 watch

監聽值的變化
watch: {
value (newVal, oldval) {
this.$emit('on-change', JSON.parse(JSON.stringify(newVal)))
}
}

4.checkbox

樣式 :checked
用來做被選中后的效果

5.[Vue warn]:

Attributes "class", ":transition" are ignored on component <router-view> because the component is a fragment instance: http://vuejs.org/guide/components.html#Fragment-Instance

template下只能有一個根節點,否則報上面的警告。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM