<!DOCTYPE html>
</html lang=""en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div class="ids">
<ul>
<li v-for="value in arr">{{value}}</li>
<li v-for="val in obj"></li>
<li v-for="(ins,sda) in arr"></li>
<li v-for="value in ars">{{value.num}}{{value.name}}{{value.price}}</li>
</ul>
<table border="1">
<thead>
<tr>
<th>编号</th>
<th>名字</th>
<th>单价</th>
</tr>
</thead>
<tbody>
<tr v-for="val in ars">
<td>{{val.unm}}</td>
<td>{{val.name}}</td>
<td>{{val.price}}</td>
</tr>
</tbody>
</table>
</div>
<script src="js/vue.js"></script>
<script>
new Vue({
el:".ids",
data:{
arr:[1,2,23,24],
obj:{
name:"名字",
age:18
}
ars:[
{num:1,name:apple,price:3}
{num:2,name:banner,price:2}
{num:3,name:orange,price:5}
}
}
})
</script>
</body>
</html>
网友评论