Skip to content

KTagInput

示例

Tag Input (press Enter or comma to add)

Vue TypeScript

Tags: Vue, TypeScript

With max tags (3)

Tag 1

An input field for adding and removing text tags.

Props

NameTypeDefaultDescription
modelValuestring[][]The current list of tags.
placeholderstring'Add tag...'Placeholder text for the input field.
disabledbooleanfalseWhether the input is disabled.
maxTagsnumberMaximum number of allowed tags.

Emits

NameParametersDescription
update:modelValuestring[]Emitted when tags are added or removed.

Slots

NameDescription
This component does not provide slots.

Basic Usage

vue
<script setup>
import { ref } from 'vue'
import { KTagInput } from '@kK-2004/ui-component'

const tags = ref(['vue', 'typescript'])
</script>

<template>
  <KTagInput v-model="tags" placeholder="Add a tag..." :max-tags="5" />
</template>