diff options
Diffstat (limited to '')
-rw-r--r-- | third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/vuejs-cli/src/main.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/vuejs-cli/src/main.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/vuejs-cli/src/main.js new file mode 100644 index 0000000000..c963425730 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/vuejs-cli/src/main.js @@ -0,0 +1,28 @@ +// The Vue build version to load with the `import` command +// (runtime-only or standalone) has been set in webpack.base.conf with an alias. +import Vue from 'vue' +import App from './App' +import Director from 'director/build/director' + +/* eslint-disable no-new */ +window.VueApp = new Vue({ + el: '#app', + render: h => h(App) +}) + +const router = new Director.Router(); + +['all', 'active', 'completed'].forEach(visibility => { + router.on(visibility, () => { + window.VueApp.filter = visibility; + }); +}); + +router.configure({ + notfound: function () { + window.location.hash = ''; + window.VueApp.filter = 'all'; + } +}); + +router.init();
\ No newline at end of file |