0👍
Here is my solution for the issue, I have split chips within saveChip function
methods: {
saveChip() {
const {chips, currentInput, set} = this;
if ((set && chips.indexOf(currentInput) === -1) || !set) {
this.chips = this.chips.concat(currentInput.trim(' ').split(','))
}
this.currentInput = '';
},
deleteChip(chip) {this.chips = this.chips.filter(c => c !== chip)}
},
template: `
<div class="chip-container">
<div v-for="(chip, i) of chips" :key="chip.label">
<span
class="chip" v-for="oneChip in chip.split(',')" v-text="oneChip"
@click="deleteChip(oneChip)">
</span>
</div>
<input v-model="currentInput" @keypress.enter="saveChip" >
</div>
`
})
- [Vuejs]-How to pass down props / all of the values of an object for a dynamic component
- [Vuejs]-Vue wait until external request finished
Source:stackexchange.com