JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/vue@2.2.2/dist/vue.js"></script>
<div id="app">
<span v-for="(val, key, index) in person">{{key}}: {{val}}<span v-if="index !== last">, </span> </span>
</div>
JavaScript
new Vue({
el: "#app",
computed: {
last(){
return Object.keys(this.person).length-1;
}
},
data:{
person: {name: 'Joe', age: 35, department: 'IT'}
}
});