From 2adfa500d1f04bb0ccca74f382acd3f7dd11c0a9 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Mon, 10 Oct 2016 09:34:15 +0200 Subject: [PATCH] start using vue-router --- package.json | 1 + src/App.vue | 27 +-------------------------- src/main.js | 2 ++ src/routes.js | 20 ++++++++++++++++++++ 4 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 src/routes.js diff --git a/package.json b/package.json index 5f81417..5a78a14 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "pilou": "^0.1.4", "tether": "^1.3.7", "vue": "^2.0.1", + "vue-router": "^2.0.0", "vuex": "^2.0.0" }, "devDependencies": { diff --git a/src/App.vue b/src/App.vue index 958f56b..aeb00fa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -93,32 +93,7 @@ - diff --git a/src/main.js b/src/main.js index 43f04bd..0fed95a 100644 --- a/src/main.js +++ b/src/main.js @@ -7,6 +7,7 @@ import LessPass from './App.vue' import 'bootstrap/dist/js/bootstrap.min'; import Store from './store' import Storage from './api/storage'; +import router from './routes'; const storage = new Storage(); const store = Store(storage.json()); @@ -14,5 +15,6 @@ const store = Store(storage.json()); new Vue({ el: '#app', store, + router, render: h => h(LessPass) }); diff --git a/src/routes.js b/src/routes.js new file mode 100644 index 0000000..261b433 --- /dev/null +++ b/src/routes.js @@ -0,0 +1,20 @@ +import Vue from 'vue'; +import VueRouter from 'vue-router'; + +import PasswordGenerator from './components/PasswordGenerator'; +import Login from './components/Login'; +import Register from './components/Register'; +import ForgotPassword from './components/ForgotPassword'; +import Passwords from './components/Passwords'; + +Vue.use(VueRouter); + +const routes = [ + {path: '/', component: PasswordGenerator}, +]; + +const router = new VueRouter({ + routes +}); + +export default router; \ No newline at end of file