0
我想渲染使用vue.js表,但我有很多问题。我不知道如何使用v-for来渲染它。我尝试了几乎所有的东西。在控制台中,一切看起来都不错,但表格清晰。如何正确地做到这一点?为什么我的vue.js表格不会渲染?
<template>
<table class="table table-striped ">
<thead>
<tr>
<th></th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr v-for="users in usr" :is="users" :usr="users">
<td>{{usr.name}}</td>
<td>{{usr.name}}</td>
</tr>
</tbody>
</table>
</template>
<script>
export default {
props: [
'user',
'users'
],
data: function() {
return {
usr: [],
}
},
}
</script>
你'v型for'是不可理解的。 'usr'是一个永远不会被填充的空数组。 –