<div id="app">
<table border="" cellspacing="0" width="300px">
<tr>
<td>编号</td>
<td>名称</td>
<td>单价</td>
</tr>
<tr v-for="l in val">
<td>{{l.num}}</td>
<td>{{l.name}}</td>
<td>{{l.price}}</td>
</tr>
</table>
</div>
js部分
new Vue({
el:"#app",
data:{
val:[
{
num:'1',
name:"apple",
price:'5'
},
{
num: '2',
name: "banana",
price: '8'
}
]
}
})
输出结果:
Image 1.png
网友评论