Skip to content

Commit

Permalink
Renaming method and watch on current tags prop
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Sep 14, 2017
1 parent f3dfa3f commit da5239f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Modules/Tag/Assets/js/components/TagInput.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<el-form-item label="Tags">
<el-select v-model="tags" multiple filterable allow-create @change="doSomething">
<el-select v-model="tags" multiple filterable allow-create @change="triggerEvent">
<el-option v-for="tag in availableTags"
:key="tag.slug"
:label="tag.slug"
Expand All @@ -25,14 +25,16 @@
}
},
methods: {
doSomething() {
triggerEvent() {
this.$emit('input', this.tags);
}
},
mounted() {
console.log(this.currentTags);
if (this.currentTags !== null) {
watch: {
currentTags: function () {
this.tags = this.currentTags;
}
},
mounted() {
axios.get(route('api.tag.tag.by-namespace', {namespace: this.namespace}))
.then(response => {
this.availableTags = response.data;
Expand Down

0 comments on commit da5239f

Please sign in to comment.