v-for comma separated

70

vue implode array -

// If all you care about is comma separation,
// use Javascript's built-in join method:

{{ list.join(', ') }}

v-for comma separated -

<script src="https://vuejs.org/js/vue.min.js"></script>
<div id="demo">
  <span v-for="(list, index) in lists">
    <span>{{list}}</span><span v-if="index+1 < lists.length">, </span>
  </span>
</div>

Comments

Submit
0 Comments