-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
haitaodesign
committed
Aug 20, 2019
1 parent
c331fdc
commit 48acb1f
Showing
12 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default [ | ||
{ | ||
path: '/home', | ||
home: 'home', | ||
component: () => import(/* webpackChunkName: "home" */ '@/views/home/index.vue') | ||
} | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default [ | ||
{ | ||
path: '/other', | ||
name: 'other', | ||
component: () => import(/* webpackChunkName: "other" */ '@/views/other/index.vue') | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
const modules = require.context('.', true, /\.js$/) | ||
let moduleRoutes = [] | ||
modules.keys().forEach(key => { | ||
if (key !== './index.js') { | ||
moduleRoutes = moduleRoutes.concat(modules(key).default) | ||
} | ||
}) | ||
// console.log(moduleRoutes) | ||
export default moduleRoutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default [ | ||
{ | ||
path: '/login', | ||
component: () => import(/* webpackChunkName: "login" */ '@/views/login/index.vue') | ||
} | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
import RouterModules from './modules' | ||
import HomeRouters from './home' | ||
import LoginRouters from './login' | ||
const commonRoute = [{ | ||
path: '/' | ||
path: '/', | ||
name: 'root', | ||
redirect: '/home', | ||
component: () => import(/* webpackChunkName: "layout" */ '@/views/layout/index.vue'), | ||
children: HomeRouters | ||
}] | ||
export default commonRoute.concat(RouterModules) | ||
// TODO: 模块多到一定的规模,可以通过按需构建达到加快开发环境体验的目的 | ||
export default commonRoute.concat(LoginRouters) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<div class="home"> | ||
dddd | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Home' | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<div class="layout"> | ||
<router-link :to="{ name: 'other' }"> | ||
<span>other</span> | ||
</router-link> | ||
<router-view></router-view> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Layout' | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<div class="login"> | ||
login | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Login' | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<div class="ohter"> | ||
other | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Ohter' | ||
} | ||
</script> |