Skip to content

Instantly share code, notes, and snippets.

@neves
Created February 27, 2017 13:34
Show Gist options
  • Save neves/d3db343a4d91ede65e668de4beee45a9 to your computer and use it in GitHub Desktop.
Save neves/d3db343a4d91ede65e668de4beee45a9 to your computer and use it in GitHub Desktop.
Vue.component('tag-editor', {
template: `<div class="tag-editor">
<tag-input v-model="editableValue"></tag-input>
<tag-list v-model="editableValue"></tag-list>
</div>`,
props: ['value'],
computed: {
editableValue: {
get () {
return this.value || []
},
set (val) {
this.$emit('input', val.slice())
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment