1.下拉框組件組件UI展示:

下拉框圖片展示.png
2.組件調(diào)用
html代碼:
<xyselect v-bind="testselect"></xyselect>
js代碼:
data() {
testselect: {
//*下拉框數(shù)據(jù),一般通過ajax獲取數(shù)據(jù),必填
getdata: [],
//*必須獲取一個(gè)key,必填
getkey: 'reasonId',
//*選取展示對(duì)應(yīng)字段內(nèi)容,必填
getlabel: ['reasonName', 'reasonId'],
//給當(dāng)前下拉框設(shè)置class類名,用于修改css'樣式
popperclass: 'myclass',
//*下拉框頭部配置的內(nèi)容(decs),prop對(duì)應(yīng)字段名,必填
headertitle: [{
decs: '交易原因',
prop: 'reasonName'
},
{
decs: '描述',
prop: 'description'
}
],
//*選中的值,一般是一個(gè)對(duì)象形式返回,必填
getvalue: {},
//下拉框change事件,不用時(shí)可不寫
selectchange: (val) = >{},
//下拉框focus事件,不用時(shí)可不寫
xyfocus: (event) = >{},
//下拉框blur事件,不用時(shí)可不寫
xyblur: (event) = >{},
//下拉框clear事件,不用時(shí)可不寫
xyclear: (event) = >{}
},
}