keyword-input.md
1.22 KB
KeywordInput 关键词输入器
自定义输入一组数据以数组或者逗号分隔的方式记录
d61ca41aa0bf59101b9ff4ce48d0c0d4a7674ea9/examples/views/docs/component/keyword-input.md#">基础用法
::: snippet 默认返回值类型为Array
<template>
<div>
{{ inputValue }}
<eagle-keyword-input v-model="inputValue" style="width: 300px;" placeholder="输入内容,回车确认" clearable></eagle-keyword-input>
</div>
</template>
<script>
export default {
data: () => ({
inputValue: []
}),
}
</script>
:::
d61ca41aa0bf59101b9ff4ce48d0c0d4a7674ea9/examples/views/docs/component/keyword-input.md#">字符串类型
::: snippet 返回值类型为String
<template>
<div>
"{{ inputValue }}"
<eagle-keyword-input v-model="inputValue" style="width: 300px;" type="string" deletable></eagle-keyword-input>
</div>
</template>
<script>
export default {
data: () => ({
inputValue: ''
}),
}
</script>
:::
API
Attribute 属性
参数|说明|类型|可选值|默认值 -|-|-|-|- value / v-model | 绑定值 | String,Array | - | - placeholder | 占位文本 | String | - | 请输入 unique | 唯一值,设置后不会出现相同的值 | Boolean | - | true deletable | 是否能通过删除键删除上一个词 | Boolean | - | false clearable | 是否可清空 | Boolean | - | false type | 返回值类型 | String | array,string | array