-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
103 lines (96 loc) · 3.91 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!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>Vue清单应用</title>
<!-- <link rel="stylesheet" href="./lib/normalize.css"> -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.css">
<link rel="stylesheet" href="./css/main.css">
</head>
<body>
<div id="main">
<div class="navbar">
<h1>Vue清单应用</h1>
</div>
<div class="header">
想要做什么?
</div>
<div class="wrap list-group">
<form @submit.prevent="merge" class="task-form list-group-item">
<!-- <div class="wrap"> -->
<input id="task-input" v-model="current.title" type="text" autocomplete="off" placeholder="想要做什么?">
<div v-if="current.id" class="detail">
<textarea v-model="current.desc" placeholder="请输入具体内容..." style="width:100%; max-width:100%"></textarea>
<div style="margin:10px 30px;">
提醒时间:
<input v-model="current.alert_at" type="datetime-local">
<br />
<button class="btn btn-danger btn-block" type="submit">提交</button>
</div>
</div>
</form>
<div class="task-list incompleted">
<!-- <div class="wrap"> -->
<task :todo="todo" v-if="!todo.completed" v-for="(todo, index) in list">
<!-- 模块化 -->
</task>
<!-- </div> -->
</div>
<div class="task-list">
<!-- <div class="wrap"> -->
已完成
<div v-if="todo.completed" v-for="(todo, index) in list" class="completed task-item list-group-item">
<button class="btn btn-default" type="button" @click="toggle_complete(todo.id)">
<span class="glyphicon glyphicon-remove"></span>
</button>
{{todo.title}}
<div class="btn-group" style="float:right;">
<button class="btn btn-default" @click="toggle_detail(todo.id)">
<span class="glyphicon glyphicon-option-horizontal"></span>
</button>
<button class="btn btn-default" type="button" @click="remove(todo.id)">
<span class="glyphicon glyphicon-trash"></span>
</button>
<button class="btn btn-default" type="button" @click="set_current(todo)">
<span class="glyphicon glyphicon-pencil"></span>
</button>
</div>
<div v-if="todo.show_detail" class="detail">
{{todo.desc || '暂无详情'}}
</div>
</div>
<!-- </div> -->
</div>
</div>
</div>
</div>
<!-- <audio id="alert-sound" src="./sound/alert.mp3" controls></audio> -->
<template id="task-tpl">
<div class="task-item list-group-item">
<button class="btn btn-default" type="button" @click="action('toggle_complete', todo.id)">
<span class="glyphicon glyphicon-ok"></span>
</button>
<span class="title">{{todo.title}}</span>
<div class="btn-group" style="float:right;">
<button class="btn btn-default" @click="action('toggle_detail', todo.id)">
<span class="glyphicon glyphicon-option-horizontal"></span>
</button>
<button class="btn btn-default" @click="action('remove', todo.id)">
<span class="glyphicon glyphicon-trash"></span>
</button>
<button class="btn btn-default" @click="action('set_current', todo)">
<span class="glyphicon glyphicon-pencil"></span>
</button>
</div>
<div v-if="todo.show_detail" class="detail">
{{todo.desc || '暂无详情'}}
</div>
</div>
</template>
<script src="./lib/vue.js"></script>
<script src="./js/myStorage.js"></script>
<script src="./js/main.js"></script>
</body>
</html>