?& ltEl" />
& ltdiv & gt
& ltEl-select v-model = " value 1 " multiple placeholder = " Please select " @ remove-tag = " aa " @ change = " getvalue " >
?& ltEl-option v-for = " item in options ":key = " item . id "?:label = " item . label ":value = " item . id " & gt;{ { item.label } } & lt/El-option & gt;
& lt/El-select & gt;
& lt/div & gt;
& lt/template & gt;
& lt腳本& gt
導出默認值{
data(){
?返回{
選項:[],
值1: [],
人員類型:""
?}
},
方法:{
getvalue(){
console.log(this.value1)
},
headSelect(){
console.log(這個。人員類型)
}
},
已創建(){
setTimeout(()= & gt;{?//模擬數據
var arr =[{
?id:1,
?值:“選項1”,
?標簽:“香蕉”
}, {
id:2,
?值:“選項2”,
?標簽:“雙皮奶”
}, {
id:3,
?值:“選項3”,
?標簽:“蚵仔煎”
}, {
id:4,
?值:“選項4”,
?標簽:“龍須面”
}, {
id:5,
?值:“選項5”,
?標簽:“北京烤鴨”
}]
?this.options = arr
?},1000)
}
}
& lt/script & gt;