Renaming method and watch on current tags prop

parent f3dfa3f8
<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"
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment