vue-tags-input icon indicating copy to clipboard operation
vue-tags-input copied to clipboard

how to add parameters in @tags-changed="update"?

Open LaughingCoy opened this issue 6 years ago • 1 comments

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; },

LaughingCoy avatar May 07 '19 02:05 LaughingCoy

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) {
    // 
}

ghost avatar Jun 17 '19 13:06 ghost