fix(select2): 默认添加clearable属性 (#240)

* fix(select2): 默认添加clearable属性


Co-authored-by: OrangeM21 <orangemtony@gmail.com>
This commit is contained in:
fit2bot
2020-07-24 10:35:41 +08:00
committed by GitHub
parent 30d4044d20
commit f2514f68b8
2 changed files with 8 additions and 0 deletions

View File

@@ -76,6 +76,9 @@ export default {
case 'field':
type = ''
field.component = Select2
if (fieldMeta.required) {
field.el.clearable = false
}
break
case 'string':
type = 'input'

View File

@@ -8,6 +8,7 @@
:remote-method="filterOptions"
:multiple="multiple"
filterable
:clearable="clearable"
popper-append-to-body
class="select2"
v-bind="$attrs"
@@ -69,6 +70,10 @@ export default {
type: Boolean,
default: true
},
clearable: {
type: Boolean,
default: true
},
// 初始化值,也就是选中的值
value: {
type: [Array, String, Number, Boolean],