Similar to template v-if
, you can also use a <template>
tag with v-for
to render a block of multiple elements. For example:
<ul>
<template v-for="item in items">
<li>{{ item.msg }}</li>
<li class="divider" role="presentation"></li>
</template>
</ul>
So in order to get sibling elements (and yeah, a breaking space character  
would count as one), you'll have to add the loop to a parent <template>
container and then include any elements / spacing you want in the looped contents like this:
<!-- language: lang-html -->
<pre><code><template v-for="fruit in fruits" >
<span>{{fruit}}</span><b>&#32;</b>
</template></code></pre>
As of Vue 2.x+, templates trim any breaking space characters, even if they are escaped.
Instead, you can add a slot or text interpolation like this:
<!-- language: lang-html -->
<pre><code><template v-for="fruit in fruits" >
<span>{{fruit}}</span><b><slot> </slot></b>
</template></code></pre>
<!-- language: lang-html -->
<pre><code><template v-for="fruit in fruits" >
<span>{{fruit}}</span><b>{{ ' ' }}</b>
</template></code></pre>
If you only want spaces in-between elements, you can output the space conditionally:
<!-- language: lang-html -->
<pre><code><template v-for="<b>(fruit, i)</b> in fruits" >
<span>{{fruit}}</span><b>{{ i < fruits.length -1 ? ', ': '' }}</b>
</template></code></pre>
Demo in Stack Snippets
<!-- begin snippet: js hide: true console: true babel: false -->
<!-- language: lang-js -->
var app = new Vue({
el: '#app',
data: {
fruits: ["apple", "banana", "carrot"]
}
});
<!-- language: lang-html -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.0/vue.js"></script>
<div id="app">
<template v-for="(fruit, i) in fruits" >
<span>{{fruit}}</span>{{ i < fruits.length -1 ? ', ': '' }}
</template>
</div>
<!-- end snippet -->
Further Reading:
Issue #1841 - Suggestion: v-glue / v-for element joins