Skip to content

Commit b8c3b5a

Browse files
committed
todomvc example: pre-initialize state before mounting app
1 parent c1d8ccb commit b8c3b5a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/todomvc/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
height: 60px;
1717
}
1818
.todo-move, .todo-enter-active, .todo-leave-active {
19-
transition: all .25s cubic-bezier(.55,0,.1,1);
19+
transition: all .25s cubic-bezier(.5,0,.1,1);
2020
}
2121
.todo-enter, .todo-leave-active {
2222
opacity: 0;
@@ -94,6 +94,9 @@ <h1>todos</h1>
9494
<script>metrics.beforeRender = now()</script>
9595
<script src="js/app.js"></script>
9696
<script src="js/routes.js"></script>
97+
<script>
98+
app.$mount('.todoapp')
99+
</script>
97100
<script>metrics.afterRender = now()</script>
98101
<script src="perf.js"></script>
99102
</body>

examples/todomvc/js/app.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
};
2222

2323
exports.app = new Vue({
24-
25-
// the root element that will be compiled
26-
el: '.todoapp',
27-
2824
// app initial state
2925
data: {
3026
todos: todoStorage.fetch(),

0 commit comments

Comments
 (0)