Browse Source
* fix root v-else not rendering in production and switched examples to minified vue for better prod coverage * add dev build comment to examples * convert tabs to spaces in todomvc example for consistencydev
Chris Fritz
8 years ago
committed by
Evan You
14 changed files with 99 additions and 79 deletions
@ -1,68 +1,69 @@ |
|||||
<!doctype html> |
<!doctype html> |
||||
<html data-framework="vue"> |
<html data-framework="vue"> |
||||
<head> |
<head> |
||||
<meta charset="utf-8"> |
<meta charset="utf-8"> |
||||
<title>Vue.js • TodoMVC</title> |
<title>Vue.js • TodoMVC</title> |
||||
<link rel="stylesheet" href="https://unpkg.com/todomvc-app-css/index.css"> |
<link rel="stylesheet" href="https://unpkg.com/todomvc-app-css/index.css"> |
||||
<script src="https:unpkg.com/director/build/director.js"></script> |
<script src="https:unpkg.com/director/build/director.js"></script> |
||||
<style>[v-cloak] { display: none; }</style> |
<style>[v-cloak] { display: none; }</style> |
||||
</head> |
</head> |
||||
<body> |
<body> |
||||
<section class="todoapp"> |
<section class="todoapp"> |
||||
<header class="header"> |
<header class="header"> |
||||
<h1>todos</h1> |
<h1>todos</h1> |
||||
<input class="new-todo" |
<input class="new-todo" |
||||
autofocus autocomplete="off" |
autofocus autocomplete="off" |
||||
placeholder="What needs to be done?" |
placeholder="What needs to be done?" |
||||
v-model="newTodo" |
v-model="newTodo" |
||||
@keyup.enter="addTodo"> |
@keyup.enter="addTodo"> |
||||
</header> |
</header> |
||||
<section class="main" v-show="todos.length" v-cloak> |
<section class="main" v-show="todos.length" v-cloak> |
||||
<input class="toggle-all" type="checkbox" v-model="allDone"> |
<input class="toggle-all" type="checkbox" v-model="allDone"> |
||||
<ul class="todo-list"> |
<ul class="todo-list"> |
||||
<li v-for="todo in filteredTodos" |
<li v-for="todo in filteredTodos" |
||||
class="todo" |
class="todo" |
||||
:key="todo.id" |
:key="todo.id" |
||||
:class="{ completed: todo.completed, editing: todo == editedTodo }"> |
:class="{ completed: todo.completed, editing: todo == editedTodo }"> |
||||
<div class="view"> |
<div class="view"> |
||||
<input class="toggle" type="checkbox" v-model="todo.completed"> |
<input class="toggle" type="checkbox" v-model="todo.completed"> |
||||
<label @dblclick="editTodo(todo)">{{ todo.title }}</label> |
<label @dblclick="editTodo(todo)">{{ todo.title }}</label> |
||||
<button class="destroy" @click="removeTodo(todo)"></button> |
<button class="destroy" @click="removeTodo(todo)"></button> |
||||
</div> |
</div> |
||||
<input class="edit" type="text" |
<input class="edit" type="text" |
||||
v-model="todo.title" |
v-model="todo.title" |
||||
v-todo-focus="todo == editedTodo" |
v-todo-focus="todo == editedTodo" |
||||
@blur="doneEdit(todo)" |
@blur="doneEdit(todo)" |
||||
@keyup.enter="doneEdit(todo)" |
@keyup.enter="doneEdit(todo)" |
||||
@keyup.esc="cancelEdit(todo)"> |
@keyup.esc="cancelEdit(todo)"> |
||||
</li> |
</li> |
||||
</ul> |
</ul> |
||||
</section> |
</section> |
||||
<footer class="footer" v-show="todos.length" v-cloak> |
<footer class="footer" v-show="todos.length" v-cloak> |
||||
<span class="todo-count"> |
<span class="todo-count"> |
||||
<strong>{{ remaining }}</strong> {{ remaining | pluralize }} left |
<strong>{{ remaining }}</strong> {{ remaining | pluralize }} left |
||||
</span> |
</span> |
||||
<ul class="filters"> |
<ul class="filters"> |
||||
<li><a href="#/all" :class="{ selected: visibility == 'all' }">All</a></li> |
<li><a href="#/all" :class="{ selected: visibility == 'all' }">All</a></li> |
||||
<li><a href="#/active" :class="{ selected: visibility == 'active' }">Active</a></li> |
<li><a href="#/active" :class="{ selected: visibility == 'active' }">Active</a></li> |
||||
<li><a href="#/completed" :class="{ selected: visibility == 'completed' }">Completed</a></li> |
<li><a href="#/completed" :class="{ selected: visibility == 'completed' }">Completed</a></li> |
||||
</ul> |
</ul> |
||||
<button class="clear-completed" @click="removeCompleted" v-show="todos.length > remaining"> |
<button class="clear-completed" @click="removeCompleted" v-show="todos.length > remaining"> |
||||
Clear completed |
Clear completed |
||||
</button> |
</button> |
||||
</footer> |
</footer> |
||||
</section> |
</section> |
||||
<footer class="info"> |
<footer class="info"> |
||||
<p>Double-click to edit a todo</p> |
<p>Double-click to edit a todo</p> |
||||
<p>Written by <a href="http://evanyou.me">Evan You</a></p> |
<p>Written by <a href="http://evanyou.me">Evan You</a></p> |
||||
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p> |
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p> |
||||
</footer> |
</footer> |
||||
|
|
||||
<script> |
<script> |
||||
// for testing |
// for testing |
||||
if (navigator.userAgent.indexOf('PhantomJS') > -1) localStorage.clear() |
if (navigator.userAgent.indexOf('PhantomJS') > -1) localStorage.clear() |
||||
</script> |
</script> |
||||
<script src="../../dist/vue.js"></script> |
<!-- Delete ".min" for console warnings in development --> |
||||
<script src="app.js"></script> |
<script src="../../dist/vue.min.js"></script> |
||||
</body> |
<script src="app.js"></script> |
||||
|
</body> |
||||
</html> |
</html> |
||||
|
Loading…
Reference in new issue