清新組件庫:http://ifresh-ui.yating.online/
源碼地址:https://github.com/Chenyating/iFresh-ui
select組件遇到的問題
思路:單選跟多選,就是radio跟checkbox的結合體;
條件判斷,是否可以多選。
z-index
失效的原因:
- 父級元素position可能是relative,或者是沒有position;
- 元素存在float屬性
解決辦法:
- position設置部位relative
- 去掉float,清除浮動,浮動元素設置position;
- overflow設置爲auto;
tabindex
按tab建的時候順序觸發,可以有blur事件跟focus事件;
展示
- 顯示項目(已經選中的框)(框)
- 下拉列表項目(已選中項的狀態)
.sync 就是一個語法糖
<parent @click="father()">點擊以後子組件出現</parent>
<children :hehe.sync='ifshow' v-if="ifshow"/>
<!-- children -->
<div @click="children">點擊以後子組件消失</div>
- 子向父傳參數,通常我都是這麼寫的:
this.$emit('funcName','false')
<children @eventName='funcName'>
funcName(value){
this.ifshow=value
}
- 但其實可以這麼寫:
this.$emit('update:Name','false')
<children @update:Name='towho'>
等同於=>@update:Name=function(value){towho=value}
等同於=>@update:Name=value=>towho=value
等同於=>:Name.sync=towho
<children :Name.sync='towho'/>