-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Description
I'm not sure if this is a bug or if I'm doing something wrong or perhaps that's the intended behavior but if I have a setup like this:
<template>
<div>
<tags-input element-id="tags"
v-model="selectedTags"
:existing-tags="availableTags"
:before-adding-tag="checkIfExists"
typeahead-style="dropdown"
placeholder="Tags"
@tag-removed="remove"
@tag-added="add"
:typeahead="true" v-if="!loading"></tags-input>
</div>
</template>
<script>
import Tag from '../Models/Tag'
export default {
...
data(){
return {
tagLabel: 'tags',
tagInput: '',
selectedTags: [],
loading: true,
}
},
methods:{
checkIfExists(item){
if(!item.key){
if(confirm(window.translate('dictionary.addNewTag'))){
axios.post('/api/tags/create', {tagname: item.value})
.then(response => {
var respTag = response.data.data;
Tag.insert({
data: respTag
});
this.selectedTags.push(respTag);
});
}
return false;
}else{
return true;
}
},
}
}
</script>
As you can see, I append a new tag to tags list with this line this.selectedTags.push(respTag); however, it does not fire a "tag-added" event
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels