vue.js建立一个简单的表格

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div id="app">
<table border="1px" width="600px">
<tr>
<td>姓名</td>
<td>年龄</td>
<td>性别</td>
</tr>
<tr v-for="person in people">
<td>{{ person.name }}</td>
<td>{{ person.age }}</td>
<td>{{ person.sex }}</td>
</tr>
</table>
</div> </body> <script type="text/javascript" src="${pageContext.request.contextPath }/js/vue.min.js"></script>
<script type="text/javascript">
var vm = new Vue({
el: '#app',
data: {
people: [{
name: 'Zhangsan',
age: ,
sex: '男'
},
{
name: 'Lucy',
age: ,
sex: '女'
},
{
name: 'Tom',
age: ,
sex: '男'
},
{
name: 'Jesen',
age: ,
sex: '男'
}]
}
});
</script>
</html>
上一篇:转:Linux Shell编程入门


下一篇:Java的IO以及线程练习