3👍
✅
Just remove a semicolon ;
in your template.
new Vue({
el: "#app",
data() {
return {
Threads: [1, 2, 3]
}
},
methods: {
getName(Thread) {
return 1;
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<div v-for="Thread in Threads">
<p>{{ getName(Thread) }}</p>
</div>
</div>
Source:stackexchange.com