Form
Tag Input
Type and press Enter to add a tag. Backspace on an empty field removes the last tag.
import { TagInputComponent, type TagItem } from '@/MigsLab/shared'
Example
Add or remove a tag.
const tags = ref<TagItem[]>([{ id: 1, label: 'Vue' }])
<TagInputComponent v-model="tags" @tag-added="Tag_Added" @tag-removed="Tag_Removed" />API
Props
| Name | Type | Default | Description |
|---|---|---|---|
v-model | TagItem[] | [] | Tags as { id, label }. |
placeholder | string | 'Type and press Enter to add a tag' | Input placeholder. |
allowDuplicates | boolean | false | Allow two tags with the same label. |
disabled | boolean | false | Disable the text field. |
Events
| Event | Payload | Description |
|---|---|---|
tag-added | TagItem | A tag was added. |
tag-removed | TagItem | A tag was removed. |