Browse Source

todomvc example: pre-initialize state before mounting app

dev
Evan You 8 years ago
parent
commit
b8c3b5ae74
  1. 5
      examples/todomvc/index.html
  2. 4
      examples/todomvc/js/app.js

5
examples/todomvc/index.html

@ -16,7 +16,7 @@
height: 60px; height: 60px;
} }
.todo-move, .todo-enter-active, .todo-leave-active { .todo-move, .todo-enter-active, .todo-leave-active {
transition: all .25s cubic-bezier(.55,0,.1,1); transition: all .25s cubic-bezier(.5,0,.1,1);
} }
.todo-enter, .todo-leave-active { .todo-enter, .todo-leave-active {
opacity: 0; opacity: 0;
@ -94,6 +94,9 @@
<script>metrics.beforeRender = now()</script> <script>metrics.beforeRender = now()</script>
<script src="js/app.js"></script> <script src="js/app.js"></script>
<script src="js/routes.js"></script> <script src="js/routes.js"></script>
<script>
app.$mount('.todoapp')
</script>
<script>metrics.afterRender = now()</script> <script>metrics.afterRender = now()</script>
<script src="perf.js"></script> <script src="perf.js"></script>
</body> </body>

4
examples/todomvc/js/app.js

@ -21,10 +21,6 @@
}; };
exports.app = new Vue({ exports.app = new Vue({
// the root element that will be compiled
el: '.todoapp',
// app initial state // app initial state
data: { data: {
todos: todoStorage.fetch(), todos: todoStorage.fetch(),

Loading…
Cancel
Save