(component): [tagInput]添加事件

This commit is contained in:
sight
2022-09-26 20:44:48 +08:00
parent 4e9604377b
commit af86d77e17
2 changed files with 99 additions and 33 deletions

View File

@@ -13,7 +13,14 @@
::: demo 使用 `lay-tag-input` 标签, 创建标签输入框。
<template>
<lay-tag-input v-model="data1" v-model:inputValue="inputValue1" placeholder="请输入" style="width:320px"></lay-tag-input>
<lay-tag-input
v-model="data1"
v-model:inputValue="inputValue1"
allowClear
placeholder="请输入"
style="width:320px"
>
</lay-tag-input>
</template>
<script>
@@ -220,7 +227,7 @@ export default {
| size | 输入框大小 |`string` | `md` | `lg` `md` `sm` `xs`|
| inputValue | 输入框的值 | `string` | -| - |
| placeholder | 占位符 | `string` | - | - |
| readonly | 是否可关闭 | `boolean` | `false` | `true` `false`|
| readonly | 是否可只读 | `boolean` | `false` | `true` `false`|
| allowClear | 允许清空 | `boolean` | `false` | `true` `false`|
| disabled | 是否禁用 | `boolean` | `false` | `true` `false`|
| max | 最大输入标签数量 | `number` | -|-|
@@ -231,6 +238,21 @@ export default {
:::
:::title TagInput 事件
:::
:::table
| 名称 | 描述 | 参数 |
|------ |----------|-----------|
| change | 值改变时触发 | (value: (string &#124; number &#124; TagData)[]) |
| inputValueChange |输入框值改变时触发 | (inputValue: string) |
| remove|删除标签时触发| (value: string &#124; number, e: Event) |
| clear | 点击清除按钮时触发| (e: Event) |
| focus | 获得焦点时触发| (e: Event) |
| blur | 失去焦点时触发| (e: Event) |
| pressEnter| 按下 Enter 键时触发| (inputValue: string, e: Event) |
:::
:::title TagInput 方法
:::