From 1812ebbac8b84371b662b1b687d2cbcbc5b2fee7 Mon Sep 17 00:00:00 2001 From: Axolotle Date: Wed, 15 Jul 2020 17:30:09 +0200 Subject: [PATCH] add index to import all user related views and modify some routes name --- app/src/routes.js | 19 +++++++++---------- app/src/views/Home.vue | 22 +++++++++++++--------- app/src/views/user/User.vue | 2 +- app/src/views/user/UserList.vue | 4 ++-- app/src/views/user/index.js | 2 ++ 5 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 app/src/views/user/index.js diff --git a/app/src/routes.js b/app/src/routes.js index b6bbf01d..4d87d6c8 100644 --- a/app/src/routes.js +++ b/app/src/routes.js @@ -1,28 +1,27 @@ import Home from './views/Home' import Login from './views/Login' -import Users from './views/Users' -import User from './views/User' +import { UserList, User } from './views/user' const routes = [ { name: 'home', path: '/', component: Home }, { name: 'login', path: '/login', component: Login, meta: { noAuth: true } }, + + // Users routes { - name: 'users', + name: 'user-list', path: '/users', - component: Users, - meta: { - breadcrumb: [{ name: 'users', trad: 'users' }] - } + component: UserList, + meta: { breadcrumb: [{ name: 'user-list', trad: 'users' }] } }, { - name: 'user', + name: 'user-info', path: '/user/:name', component: User, props: true, meta: { breadcrumb: [ - { name: 'users', trad: 'users' }, - { name: 'user', param: 'name' } + { name: 'user-list', trad: 'users' }, + { name: 'user-info', param: 'name' } ] } } diff --git a/app/src/views/Home.vue b/app/src/views/Home.vue index 791b1191..a49ef341 100644 --- a/app/src/views/Home.vue +++ b/app/src/views/Home.vue @@ -1,7 +1,11 @@