-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (67 loc) · 2.28 KB
/
index.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>shppingcart</title>
<link rel="stylesheet" type="text/css" href="bootstrap.css"/>
<script type="text/javascript" src='js/vue.js'></script>
<script type="text/javascript" src="js/index.js"></script>
<style>
.table-striped .delbtn {
cursor: pointer;
background: #428bca;
border: none;
}
.table-striped .delbtn[disabled] {
cursor: default;
background: #999;
border: none;
}
</style>
</head>
<body>
<div id="my">
<!-- 头部 -->
<div class="page-header">
<div>
<h1 style="display: inline-block;">{{name}}的购物清单列表</h1>
<span>清单总数
<span class="label label-warning" >{{items.length}}</span>
</span>
<span>未采购数
<span class="label label-success">{{count}}</span>
</span>
</div>
</div>
<!-- 内容 -->
<div class="panel">
<div class="input-group">
<input class="form-control" type="text" v-model="val"/>
<span class="input-group-btn">
<button class="btn btn-default" @click="add()">添加</button>
</span>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>清单名称</th>
<th>已采购</th>
<th>状态</th>
<th>删除</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in items">
<td>{{item.name}}</td>
<td><input type="checkbox" v-model="item.state" @change="changeList()"/></td>
<td>{{item.state | stateFilter}}</td>
<td><button class="badge delbtn" @click="del(index)" :disabled="!item.state">删除</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>