自定义多选框 组件继承与my-tag-input 组件
Members
(inner) props
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
value |
array |
<optional> |
实现双向绑定v-model |
|||||||||||||
type |
string |
<optional> |
选择器打开方式,dialog / popover, 默认popover |
|||||||||||||
fieldPropsMap |
object |
<optional> |
表单中显示内容的字段映射,通常自定义选中选择的数据为对象格式,需要选择对象中某个字段作为 tag-input 中的标签显示字段 Properties
|
|||||||||||||
dialogProps |
object |
<optional> |
dialog弹窗的配置项(继承my-dialog的props) |
|||||||||||||
popProps |
object |
<optional> |
popover 的配置项(继承el-popover的props) Properties
|
|||||||||||||
size |
string |
<optional> |
尺寸,可选值'medium', 'small', 'mini', ''(my-tag-input参数) |
|||||||||||||
disabled |
boolean |
<optional> |
禁用(my-tag-input参数) |
|||||||||||||
readonly |
boolean |
<optional> |
只读(my-tag-input参数) |
|||||||||||||
collapseTags |
boolean |
<optional> |
折叠标签(my-tag-input参数) |
|||||||||||||
placeholder |
string |
<optional> |
输入框占位文本(my-tag-input参数) |
|||||||||||||
closable |
boolean |
<optional> |
true
|
允许删除标签(my-tag-input参数) |
||||||||||||
icon |
string |
<optional> |
el-icon-price-tag
|
输入框后缀的图标样式 (my-tag-input参数) |
属性参数
(inner) slots
Properties:
Name | Type | Description |
---|---|---|
field |
string | 表单区域(选中内容显示)插槽 |
picker |
string | 弹窗、popover 选择器插槽 |
插槽
Methods
(inner) _removeDuplicate(dataopt, targetsopt, keyopt)
去重函数(将一个数组添加到另一个数组里,需要将已有的数据去重)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
array |
<optional> |
需要排重的数据 |
targets |
array |
<optional> |
去重数据的放置目标 |
key |
string |
<optional> |
排重的标识字段 |
(inner) closePicker()
关闭选择器
(inner) openPicker()
打开选择器
Events
on-cancel
点击取消事件
on-confirm
点击确认事件