Преглед на файлове

start using vue-router

pull/342/head
Guillaume Vincent преди 8 години
родител
ревизия
2adfa500d1
променени са 4 файла, в които са добавени 24 реда и са изтрити 26 реда
  1. +1
    -0
      package.json
  2. +1
    -26
      src/App.vue
  3. +2
    -0
      src/main.js
  4. +20
    -0
      src/routes.js

+ 1
- 0
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": {


+ 1
- 26
src/App.vue Целия файл

@@ -93,32 +93,7 @@
<template>
<div id="app">
<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>
</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>

+ 2
- 0
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)
});

+ 20
- 0
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;

Зареждане…
Отказ
Запис