-
Notifications
You must be signed in to change notification settings - Fork 1
/
page.html
74 lines (65 loc) · 2.38 KB
/
page.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
<!DOCTYPE html>
<html>
<head>
<meta charset=ut<meta charset="UTF-8">
<title>基于Vue和Leancloud的todolist</title>
<meta name="keywords" content="Vue,leancloud,todolist">
<link rel="icon" href="img/logo.png" type="image/x-icon">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div id="app">
<!-- 界面部分 -->
<section id="signInAndSignUp" v-if="!currentUser">
<img class="logo" src="./img/logo.png" alt="">
<div class="formType">
<a href="#" @click.prevent="changeBtn('signup')" :class="{clickColor:isSignColor}">注册</a>
<a href="#" @click.prevent="changeBtn('login')" :class="{clickColor:isLoginColor}">登入</a>
</div>
<div class="signUp" v-if="actionType=='signUp'">
<form @submit.prevent="signUp">
<div class="formRow">
<input type="text" placeholder="Username" v-model="formData.username">
</div>
<div class="formRow">
<input type="password" placeholder="Password" v-model="formData.password">
</div>
<div class="formActions">
<input class="signUpBtn" type="submit" value="注册">
</div>
</form>
</div>
<div class="login" v-if="actionType=='login'">
<form @submit.prevent="login">
<div class="formRow">
<input type="text" placeholder="Username" v-model="formData.username">
</div>
<div class="formRow">
<input type="password" placeholder="Password" v-model="formData.password">
</div>
<div class="formActions">
<input class="logInBtn" type="submit" value="登入">
</div>
</form>
</div>
</section>
<!-- 用户内容部分 -->
<section id="todo" v-if="currentUser">
<div class="title">你好,{{currentUser.username}}!</div>
<div class="logOutBtn"><a href="#" @click.prevent="logOut">登出</a></div>
<div class="newTask">
<input type="text" v-model="newTodo" @keyup.enter="addTodo" placeholder="输入您的待办事项,按回车键">
</div>
<ol class="todos">
<li v-for="todo in todoList">
<span :class="{finish:todo.done}">{{ todo.title }}</span>
<span>{{ todo.createAt }}</span>
<a href='#' @click.prevent='isfinish(todo)' class="btn btn-done">完成</a>
<a href='#' @click.prevent='isdelete(todo)' class="btn btn-delete">删除</a>
</li>
</ol>
</section>
</div>
<script src="bundle.js"></script>
</body>
</html>