Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vue.component('tag-list', {
- template: `<div>
- <span v-for="tag, index in value" class="tag is-info" style="margin-right: 2px">
- {{tag}}
- <button class="delete is-small" @click="remove(index)"></button>
- </span>
- </div>`,
- props: ['value'],
- methods: {
- remove (index) {
- var clonedValue = this.value.slice()
- clonedValue.splice(index, 1)
- this.$emit('input', clonedValue)
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement