vue-tags-input
vue-tags-input copied to clipboard
how to add parameters in @tags-changed="update"?
example line of code:
current: <vue-tags-input id="input-tag" class="width-100" v-model="tag" :tags="users" :autocomplete-items="autocompleteItems" autofocus :add-only-from-autocomplete="true" @tags-changed="update"/>
update(newUsers) { console.log ('newUsers: ', newUsers) this.autocompleteItems = []; this.users = newUsers; },
want: <vue-tags-input id="input-tag" class="width-100" v-model="tag" :tags="users" :autocomplete-items="autocompleteItems" autofocus :add-only-from-autocomplete="true" @tags-changed="update(newUsers, value)"/>
update(newUsers, value) { console.log ('newUsers: ', newUsers) this.autocompleteItems = []; this.users = newUsers; },
I do it in this way:
<vue-tags-input @tags-changed="update(customVariable, ...arguments)" />
or
<vue-tags-input @tags-changed="update(customVariable, arguments[0])" />
Then:
update(customVariable, newTags) {
//
}