Skip to content

InputTag 标签输入框

InputTag 是一个用于输入和展示多个标签的组件,常用于关键词、标签、邮箱等需要多值输入的场景。

引入

typescript
import { InputTag } from '@versakit/vue'

使用

loading

API

属性

属性名说明类型默认值
modelValue标签值数组string[][]
placeholder占位符文本string''
disabled是否禁用booleanfalse
readonly是否只读booleanfalse
size输入框尺寸'small' | 'default' | 'large''default'
prefixIcon前缀图标string-
suffixIcon后缀图标string-
closable是否可关闭标签booleantrue
maxCount最大标签数量number-
showCount是否显示数量统计booleanfalse
autofocus自动获取焦点booleanfalse
status输入框状态'error' | 'warning' | 'success'-
unstyled是否使用无样式模式booleanfalse
pt传递模板样式InputTagPT-

事件

事件名说明参数
update:modelValue更新标签值时触发(value: string[])
change标签值变化时触发(value: string[])
add添加标签时触发(value: string)
remove移除标签时触发(value: string, index: number)
focus获得焦点时触发(event: FocusEvent)
blur失去焦点时触发(event: FocusEvent)

插槽

名称说明
prefix前缀内容
suffix后缀内容

样式接口

typescript
type InputTagPT = {
	root?: string
	wrapper?: string
	input?: string
	prefix?: string
	suffix?: string
	tag?: string
	tagClose?: string
	count?: string
}