File tree Expand file tree Collapse file tree 12 files changed +169
-31
lines changed Expand file tree Collapse file tree 12 files changed +169
-31
lines changed Original file line number Diff line number Diff line change 11
11
<sidebar ></sidebar >
12
12
<!-- 右侧视图 -->
13
13
<div class =" view" >
14
- <router-view ></router-view >
14
+ <div class =" conatiner" >
15
+ <router-view ></router-view >
16
+ </div >
15
17
</div >
16
18
</div >
17
19
</div >
@@ -45,7 +47,7 @@ export default {
45
47
.view {
46
48
width : auto ;
47
49
height : 100% ;
48
- padding : 2 rem ;
50
+ padding : 1 rem ;
49
51
position : absolute ;
50
52
left : 240px ;
51
53
right : 0 ;
@@ -54,6 +56,12 @@ export default {
54
56
padding-bottom : 30px ;
55
57
transition : left 0.3s ease-in-out ;
56
58
background : #f0f0f0 ;
59
+ .conatiner {
60
+ background : #fff ;
61
+ width : inherit ;
62
+ height : inherit ;
63
+ padding : 1rem ;
64
+ }
57
65
}
58
66
}
59
67
.sidebar-close {
Original file line number Diff line number Diff line change
1
+ /********************************定义一个方法将modules中的文件全部导入进来 start********************************/
2
+ const routerList = [ ] ;
3
+ function importAll ( r ) {
4
+ r . keys ( ) . forEach ( ( key ) => routerList . push ( r ( key ) . default ) ) ;
5
+ }
6
+ importAll ( require . context ( './modules' , true , / \. j s / ) ) ;
7
+ /********************************定义一个方法将modules中的文件全部导入进来 end********************************/
8
+
9
+ // 用户定义的全部路由
10
+ export const constantRoutes = routerList ;
Original file line number Diff line number Diff line change
1
+ export default {
2
+ name : 'form' ,
3
+ path : '/form' ,
4
+ meta : { title : '表单组件' } ,
5
+ component : ( ) => import ( '@/views/pages/form/Index.vue' ) ,
6
+ redirect : '/base_form' ,
7
+ children : [
8
+ {
9
+ name : 'base_form' ,
10
+ path : '/base_form' ,
11
+ meta : { title : '基础表单' } ,
12
+ component : ( ) => import ( '@/views/pages/form/base-form/Index.vue' ) ,
13
+ } ,
14
+ {
15
+ name : 'upload' ,
16
+ path : '/upload' ,
17
+ meta : { title : '上传组件' } ,
18
+ component : ( ) => import ( '@/views/pages/form/upload/Index.vue' ) ,
19
+ } ,
20
+ ] ,
21
+ } ;
Original file line number Diff line number Diff line change
1
+ export default {
2
+ name : 'tab' ,
3
+ path : '/tab' ,
4
+ meta : { title : '选项卡' } ,
5
+ component : ( ) => import ( '@/views/pages/tab/Index.vue' ) ,
6
+ } ;
Original file line number Diff line number Diff line change
1
+ export default {
2
+ name : 'table' ,
3
+ path : '/table' ,
4
+ meta : { title : '表格组件' } ,
5
+ component : ( ) => import ( '@/views/pages/table/Index.vue' ) ,
6
+ } ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import VueRouter from 'vue-router'
3
3
import home from './shared/home' ;
4
4
import login from './shared/login' ;
5
5
import { setTitle } from '@/utils' ;
6
-
6
+ import { constantRoutes } from './constant-routes' ;
7
7
Vue . use ( VueRouter )
8
8
9
9
const routes = [
@@ -15,6 +15,7 @@ const routes = [
15
15
redirect : '/home' ,
16
16
children : [
17
17
...home ,
18
+ ...constantRoutes ,
18
19
] ,
19
20
} ,
20
21
...login ,
Original file line number Diff line number Diff line change @@ -3,56 +3,32 @@ const state = {
3
3
sidebarOpened : true ,
4
4
title : '主页' ,
5
5
menuList : [
6
- {
7
- icon : 'el-icon-s-home' ,
8
- index : 'dashboard' ,
9
- title : '系统首页'
10
- } ,
11
6
{
12
7
icon : 'el-icon-s-order' ,
13
8
index : 'table' ,
14
9
title : '基础表格'
15
10
} ,
16
11
{
17
12
icon : 'el-icon-s-marketing' ,
18
- index : 'tabs ' ,
13
+ index : 'tab ' ,
19
14
title : 'tab选项卡'
20
15
} ,
21
16
{
22
17
icon : 'el-icon-folder-opened' ,
23
- index : '3 ' ,
18
+ index : 'form ' ,
24
19
title : '表单相关' ,
25
20
children : [
26
21
{
27
- index : 'form ' ,
22
+ index : 'base_form ' ,
28
23
title : '基本表单' ,
29
24
icon : 'el-icon-s-data' ,
30
25
} ,
31
- {
32
- index : '3-2' ,
33
- title : '三级菜单' ,
34
- children : [
35
- {
36
- index : 'editor' ,
37
- title : '富文本编辑器'
38
- } ,
39
- {
40
- index : 'markdown' ,
41
- title : 'markdown编辑器'
42
- }
43
- ]
44
- } ,
45
26
{
46
27
index : 'upload' ,
47
28
title : '文件上传'
48
29
}
49
30
]
50
- } ,
51
- {
52
- icon : 'el-icon-s-marketing' ,
53
- index : 'tabs1' ,
54
- title : 'tab1选项卡'
55
- } ,
31
+ }
56
32
] ,
57
33
} ;
58
34
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <router-view />
3
+ </template >
4
+
5
+ <script >
6
+ export default {
7
+
8
+ }
9
+ </script >
10
+
11
+ <style lang="scss" scoped>
12
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+
4
+ </div >
5
+ </template >
6
+
7
+ <script >
8
+ export default {
9
+
10
+ }
11
+ </script >
12
+
13
+ <style lang="scss" scoped>
14
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+
4
+ </div >
5
+ </template >
6
+
7
+ <script >
8
+ export default {
9
+
10
+ }
11
+ </script >
12
+
13
+ <style lang="scss" scoped>
14
+ </style >
You can’t perform that action at this time.
0 commit comments