@@ -55,6 +55,8 @@ const props = defineProps({
5555 options: { type: Array , default : () => [] },
5656 /** Key of the option's value in the option's object. */
5757 optionValue: { type: String , default: ' value' },
58+ /** The delimiter used to split pasted text into multiple tags. Only used when `taggable` is `true`. */
59+ pasteDelimiter: { type: String , default: ' ,' },
5860 placeholder: { type: String , default : () => __ (' Select...' ) },
5961 readOnly: { type: Boolean , default: false },
6062 /** When `true`, the options will be searchable. */
@@ -315,7 +317,12 @@ function onPaste(e) {
315317
316318 const pastedValue = e .clipboardData .getData (' text' );
317319
318- updateModelValue ([... (props .modelValue ?? []), ... pastedValue .split (' ,' ).map ((v ) => v .trim ())]);
320+ const tags = pastedValue
321+ .split (props .pasteDelimiter )
322+ .map ((v ) => v .trim ())
323+ .filter ((v ) => v !== ' ' );
324+
325+ updateModelValue ([... (props .modelValue ?? []), ... tags]);
319326}
320327
321328function pushTaggableOption (e ) {
0 commit comments