@@ -22,6 +22,7 @@ | |||||
"pilou": "^0.1.4", | "pilou": "^0.1.4", | ||||
"tether": "^1.3.7", | "tether": "^1.3.7", | ||||
"vue": "^2.0.1", | "vue": "^2.0.1", | ||||
"vue-router": "^2.0.0", | |||||
"vuex": "^2.0.0" | "vuex": "^2.0.0" | ||||
}, | }, | ||||
"devDependencies": { | "devDependencies": { | ||||
@@ -93,32 +93,7 @@ | |||||
<template> | <template> | ||||
<div id="app"> | <div id="app"> | ||||
<div id="lesspass" class="card"> | <div id="lesspass" class="card"> | ||||
<login v-show="page === 'login'"></login> | |||||
<register v-show="page === 'register'"></register> | |||||
<forgot-password v-show="page === 'forgotPassword'"></forgot-password> | |||||
<passwords v-show="page === 'passwords'"></passwords> | |||||
<password-generator v-show="page === 'index'"></password-generator> | |||||
<router-view></router-view> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script type="text/ecmascript-6"> | |||||
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'; | |||||
import {mapGetters} from 'vuex' | |||||
export default { | |||||
components: { | |||||
PasswordGenerator, | |||||
Login, | |||||
Register, | |||||
ForgotPassword, | |||||
Passwords, | |||||
}, | |||||
computed: mapGetters([ | |||||
'page' | |||||
]) | |||||
} | |||||
</script> |
@@ -7,6 +7,7 @@ import LessPass from './App.vue' | |||||
import 'bootstrap/dist/js/bootstrap.min'; | import 'bootstrap/dist/js/bootstrap.min'; | ||||
import Store from './store' | import Store from './store' | ||||
import Storage from './api/storage'; | import Storage from './api/storage'; | ||||
import router from './routes'; | |||||
const storage = new Storage(); | const storage = new Storage(); | ||||
const store = Store(storage.json()); | const store = Store(storage.json()); | ||||
@@ -14,5 +15,6 @@ const store = Store(storage.json()); | |||||
new Vue({ | new Vue({ | ||||
el: '#app', | el: '#app', | ||||
store, | store, | ||||
router, | |||||
render: h => h(LessPass) | render: h => h(LessPass) | ||||
}); | }); |
@@ -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; |