For vue2 projects, use @94ai/common-ui
LLMs.md

nf-keywords ​

Keyword batches support #-separated input, regex validation, case-insensitive deduplication, per-item/total limits, protected items, copying and virtualized rendering.

Examples ​

Basic usage ​

Loading example…
Basic usage

Advanced usage ​

Loading example…
Advanced usage

Props ​

Text props follow the library language when omitted; defaults below use this language.

ParameterDescriptionTypeOptionsDefault
dataData to display or restore.KeyWordItem[]—[]
modelValueCurrent value; Vue 3 v-model takes precedence over the compatibility prop.KeyWordItem[]—undefined
disabledWhether to disable the component.boolean—false
getItemDisabledStatusWhether a keyword is protected from deletion; true prevents removal.(item: KeyWordItem) => boolean—() => false
sizeControl size; mini maps to small and medium to default.stringmini / small / medium / default / large'mini'
singleLimitCharacter limit per keyword.number—3000
totalLimitTotal character limit across keywords.number—60000
placeholderCustomize the “Enter keywords and press Enter to confirm. Separate multiple keywords with #” text.string—Enter keywords and press Enter to confirm. Separate multiple keywords with #
someLimitDescCustomize the “A keyword exceeds the character limit” text.string—A keyword exceeds the character limit
allLimitDescCustomize the “Total keyword character limit exceeded” text.string—Total keyword character limit exceeded
matchDescCustomize the “Keywords matching this branch” text.string—Keywords matching this branch
priorityRecommendDescCustomize the “(Keywords are recommended)” text.string—(Keywords are recommended)
copyAllDescCustomize the “Copy all” text.string—Copy all
delAllDescCustomize the “Delete all” text.string—Delete all
noKeywordDescCustomize the “No keywords” text.string—No keywords
copySucessDescCustomize the “Copied successfully” text.string—Copied successfully
alreadyExistDescCustomize the “Keyword already exists in this branch” text.string—Keyword already exists in this branch
correctDescCustomize the “Please correct it” text.string—Please correct it
incorrectRegDescCustomize the “The keyword contains an invalid regular expression” text.string—The keyword contains an invalid regular expression

Events ​

EventDescriptionPayload
delAllRequest to delete all keywords; the parent decides whether to clear them, preserving confirmation flows.(items: KeyWordItem[])
delItemFires when a keyword is deleted; returns that keyword object.(item: KeyWordItem)
copySuccessFires after a successful copy; returns #-separated text with the trailing #.(text: string)
copyErrorFires when copying fails; returns the error.(error: unknown)
changeFires when keyword data changes; returns the current array.(items: KeyWordItem[])
update:dataUpdate the bound value.(items: KeyWordItem[])
update:modelValueUpdate the bound value.(items: KeyWordItem[])

Slots ​

No custom slots.

Exposed methods and state ​

  • tags
  • copyVal
  • keyword
  • delKeywords()
  • addFn()
  • someKey
  • allKey

Migration notes ​

Vue 3 uses modelValue / update:modelValue; legacy value, update:value and input remain available on selection components. The implementation uses public Element Plus APIs, not Element UI internals. mini maps to small; medium maps to default.

delAll is a notification: the parent decides whether to clear the array. Clipboard errors never emit a success message.