基於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下只能有一個根節點,否則報上面的警告。