-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvue-table-pag.html
46 lines (46 loc) · 1.41 KB
/
vue-table-pag.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vueTable</title>
<link rel="stylesheet" href="css/bootstrap.min.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div id="vuetable">
<h2>带分页导航的表格</h2>
<div id="tab">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>姓名</th>
<th>年龄</th>
<th>身高</th>
<th>体重</th>
<th>性别</th>
</tr>
</thead>
<tbody>
<tr v-for="user in users | limitBy 5 offSet">
<td v-for="col in column">{{user[col.name]}}</td>
</tr>
</tbody>
</table>
</div>
<div id="pag">
<ul class="pagination">
<li><a v-on:click="cur=1">首页</a></li>
<li v-bind:class="{'disabled' : cur == 1}"><a v-on:click="cur--">上一页</a></li>
<li v-for="index in indexs" v-bind:class="{ 'active': cur == index}">
<a v-on:click="btnClick(index)">{{index}}</a>
</li>
<li v-bind:class="{'disabled' : cur == all}"><a v-on:click="cur++">下一页</a></li>
<li><a v-on:click="cur=all">末页</a></li>
<li><a>共 <i class="text-danger">{{all}}</i> 页</a></li>
</ul>
</div>
</div>
<script src="js/vue.js" charset="utf-8"></script>
<script src="js/bootstrap.min.js" charset="utf-8"></script>
<script src="js/vue-table.js" charset="utf-8"></script>
</body>
</html>