问题描述
我正在尝试显示一张鲜花表,但它不会显示。我不确定如何使用我的数据来显示它们。任何帮助将不胜感激
<b-table>
<thead>
<tr>
<th>Name</th>
<th>Petals</th>
</tr>
</thead>
<tbody>
<tr v-for="flower in flowers" :key="flower.id">
<td>{{ flower.name }}</td>
<td>{{ flower.petal }}</td>
</tr>
</tbody>
</b-table>
解决方法
这不是<b-table>
的用法。
您通过<b-table>
属性为items
提供了一个数组,它将自动生成表。可以使用其他道具和插槽进一步自定义。
我建议您看一些示例,以了解基础知识如何工作。 https://bootstrap-vue.org/docs/components/table#tables
如果要自己编写结构,则应使用<b-table-simple>
。
https://bootstrap-vue.org/docs/components/table#simple-tables