-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
14 changed files
with
136 additions
and
34 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
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,4 +1,6 @@ | ||
import createImporter from './importer' | ||
import components from './components' | ||
import * as components from './components' | ||
|
||
export default createImporter(components) | ||
export const common = createImporter(components.common) | ||
|
||
export const dynamic = createImporter(components.dynamic) |
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
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,18 @@ | ||
import { dynamic } from '../components' | ||
|
||
export default [ | ||
{ | ||
path: '/access/admin', | ||
component: dynamic.permission, | ||
meta: { | ||
role: ['admin', 'user'] | ||
} | ||
}, | ||
{ | ||
path: '/access/user', | ||
component: dynamic.permission, | ||
meta: { | ||
role: ['user'] | ||
} | ||
} | ||
] |
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 @@ | ||
import commonRoutes from './common' | ||
import dynamicRoutes from './dynamic' | ||
|
||
export { | ||
commonRoutes, | ||
dynamicRoutes | ||
} |
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
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 |
---|---|---|
|
@@ -5,5 +5,8 @@ export default { | |
}, | ||
role (state) { | ||
return state.role | ||
}, | ||
routes (state) { | ||
return state.routes | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export default { | ||
SET_USERNAME: 'SET_USERNAME', | ||
SET_ROLE: 'SET_ROLE', | ||
SET_TOKEN: 'SET_TOKEN' | ||
SET_TOKEN: 'SET_TOKEN', | ||
SET_ROUTES: 'SET_ROUTES' | ||
} |
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,9 @@ | ||
import { commonRoutes } from 'ROUTER/routes' | ||
|
||
export default { | ||
username: '', | ||
role: [], | ||
token: '' | ||
token: '', | ||
routes: commonRoutes, // store current global routes map | ||
addRoutes: [] // for router.addRoutes() function | ||
} |
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,19 @@ | ||
<template> | ||
<el-main class="permission"> | ||
{{info}} | ||
</el-main> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
info: 'dynamic routes' | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="sass" scoped> | ||
</style> |