Last active
November 13, 2019 11:41
-
-
Save UnaiYecora/1c3a98f77b3a8171c0ebc34b9dae305e to your computer and use it in GitHub Desktop.
Vue.js: Show object/array as comma-separated list on a v-for
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This is how you get a comma-separated list of items in Vue.js 2.0, | |
without a comma at the end of the last item --> | |
<p v-for="(item, index) in items"> | |
{{author}}<span v-if="index != (items.length - 1)">,</span> | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice! Thanks