017——VUE中v-fo指令的使用方法

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>v-fo指令的使用方法</title>
		<script src="vue.js"></script>
	</head>
	<body>
		<div id="lantian">
			<table border="1">
				<tr>
					<th>序号</th>
					<th>编号</th>
					<th>标题</th>
					<th>老师</th>
				</tr>
				<tr v-for="(field,key) in news">
					<td>{{key}}</td>
					<td>{{field.id}}</td>
					<td>{{field.title}}</td>
					<td>{{name}}</td>
				</tr>
			</table>
		</div>
		<script>
			var app=new Vue({
			el:'#lantian',
			data:{
				name:'大象',
				news:[
					{id:11,title:'lantian.com'},
					{id:22,title:'蓝天科技'}
				]
			}
		});
		</script>
	</body>
</html>

  

posted @ 2017-12-21 13:34  生如逆旅,一苇以航  阅读(862)  评论(0编辑  收藏  举报