<el-select v-model="value" filterable placeholder="请选择" @change="select">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
data() {
return {
options: [
{ label: '选项1', value: '1' },
{ label: '选项2', value: '2' },
{ label: '选项3', value: '3' },
{ label: '选项4', value: '4' }
],
value: '',
// 选中的选项
item: {}
}
},
methods: {
select(value) {
this.item = this.options.find((item) => {
return item.value === value
})
}
}