Vue v-for表格

2018-09-11  本文已影响0人  北觅_Sir

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="UTF-8"> 
<title></title>
<script src="[vue.min (3).js](vue.min (3).js)"></script>
</head>
<body>
<div id="box">
<table border="" cellspacing="" cellpadding=""><tr v-for="v in arr">
<td>{{v.friut}}</td>
<td>{{v.name}}</td>
<td>{{v.many}}</td>
</tr>

</table> 
 </div> 
<script type="text/javascript"> 
 new Vue({ 
el:'#box', 
data:{ 
arr:[{friut:"编号",name:"水果",many:"价格"},{friut:"1",name:"apple",many:"3"},{friut:"2",name:"banana",many:"4"},{friut:"3",name:"orange",many:"5"}] 

 } 
 }) 
</script> 
</body>
 </html> 

上一篇 下一篇

猜你喜欢

热点阅读