Reputation: 357
I would like to separate some words with a semicolon. If I do it like this
<span v-for="(item, itemIndex) in arrayOfStrings"
:key="itemIndex"
v-html="item + ';'" />
the last word will also have a semicolon. How can I avoid the semicolon after the last word ?
Upvotes: 0
Views: 23
Reputation: 357
Use the join method
<span v-else>{{ arrayOfStrings.join("; ") }}</span>
Upvotes: 1