vue-tagsinput
vue-tagsinput copied to clipboard
Is it possible to add tags on paste?
So the tag would created as soon as you paste the text without having to hit enter.
i am looking for this function too, because our users often copy and paste content.
I have achieved this behavior using @tag-added event and the following handler.
@tag-added="parseKeywords"
parseKeywords: function (keyword) {
let val = keyword.value;
if (val.indexOf(',') !== -1 || val.indexOf(';') !== -1) {
this.selected.keywords.pop();
val.split(/[,;]/).forEach(val => {
let found = this.selected.keywords.some(el => el.value === val);
if (!found && val.trim().length > 0) {
this.selected.keywords.push({key:'', value: val})
}
})
}
}