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'是一個永遠不會被填充的空數組。 –