赞
踩
allow-create,是否允许用户创建新条目,需配合 filterable 使用
default-first-option,在输入框按下回车,选择第一个匹配项。需配合 filterable 或 remote 使用
<el-select
v-model="form.hello"
placeholder="请选择"
filterable
allow-create
clearable
default-first-option
:filter-method="(value) => dataFilter(value, 'hello')">
<el-option
v-for="item in options"
:key="item.val"
:label="item.name"
:value="item.val"></el-option>
</el-select>
methods: {
dataFilter(val, key) {
this.form[key] = val;
},
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。