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.
| Parameter | Description | Type | Options | Default |
|---|---|---|---|---|
data | Data to display or restore. | KeyWordItem[] | — | [] |
modelValue | Current value; Vue 3 v-model takes precedence over the compatibility prop. | KeyWordItem[] | — | undefined |
disabled | Whether to disable the component. | boolean | — | false |
getItemDisabledStatus | Whether a keyword is protected from deletion; true prevents removal. | (item: KeyWordItem) => boolean | — | () => false |
size | Control size; mini maps to small and medium to default. | string | mini / small / medium / default / large | 'mini' |
singleLimit | Character limit per keyword. | number | — | 3000 |
totalLimit | Total character limit across keywords. | number | — | 60000 |
placeholder | Customize 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 # |
someLimitDesc | Customize the “A keyword exceeds the character limit” text. | string | — | A keyword exceeds the character limit |
allLimitDesc | Customize the “Total keyword character limit exceeded” text. | string | — | Total keyword character limit exceeded |
matchDesc | Customize the “Keywords matching this branch” text. | string | — | Keywords matching this branch |
priorityRecommendDesc | Customize the “(Keywords are recommended)” text. | string | — | (Keywords are recommended) |
copyAllDesc | Customize the “Copy all” text. | string | — | Copy all |
delAllDesc | Customize the “Delete all” text. | string | — | Delete all |
noKeywordDesc | Customize the “No keywords” text. | string | — | No keywords |
copySucessDesc | Customize the “Copied successfully” text. | string | — | Copied successfully |
alreadyExistDesc | Customize the “Keyword already exists in this branch” text. | string | — | Keyword already exists in this branch |
correctDesc | Customize the “Please correct it” text. | string | — | Please correct it |
incorrectRegDesc | Customize the “The keyword contains an invalid regular expression” text. | string | — | The keyword contains an invalid regular expression |
Events
| Event | Description | Payload |
|---|---|---|
delAll | Request to delete all keywords; the parent decides whether to clear them, preserving confirmation flows. | (items: KeyWordItem[]) |
delItem | Fires when a keyword is deleted; returns that keyword object. | (item: KeyWordItem) |
copySuccess | Fires after a successful copy; returns #-separated text with the trailing #. | (text: string) |
copyError | Fires when copying fails; returns the error. | (error: unknown) |
change | Fires when keyword data changes; returns the current array. | (items: KeyWordItem[]) |
update:data | Update the bound value. | (items: KeyWordItem[]) |
update:modelValue | Update the bound value. | (items: KeyWordItem[]) |
Slots
No custom slots.
Exposed methods and state
tagscopyValkeyworddelKeywords()addFn()someKeyallKey
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.
