Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Vue.component('tag-list', {
  2. template: `<div>
  3. <span v-for="tag, index in value" class="tag is-info" style="margin-right: 2px">
  4. {{tag}}
  5. <button class="delete is-small" @click="remove(index)"></button>
  6. </span>
  7. </div>`,
  8. props: ['value'],
  9. methods: {
  10. remove (index) {
  11. var clonedValue = this.value.slice()
  12. clonedValue.splice(index, 1)
  13. this.$emit('input', clonedValue)
  14. }
  15. }
  16. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement