qdt-admin-layout 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +22 -0
- package/package.json +45 -0
- package/src/component/Aside/DefaultSidebar/index.vue +354 -0
- package/src/component/Aside/DefaultSidebar/style.scss +32 -0
- package/src/component/Aside/index.vue +30 -0
- package/src/component/Aside/style.scss +23 -0
- package/src/component/Aside/theme-dark.scss +19 -0
- package/src/component/Aside/theme-light.scss +18 -0
- package/src/component/Breadcrumb/index.vue +111 -0
- package/src/component/Breadcrumb/style.scss +27 -0
- package/src/component/CachedRouterView/index.vue +162 -0
- package/src/component/ContextMenu/functionalUse.js +26 -0
- package/src/component/ContextMenu/index.vue +140 -0
- package/src/component/ContextMenu/style.scss +30 -0
- package/src/component/ElMenu/item.vue +66 -0
- package/src/component/ElMenu/mixin.js +36 -0
- package/src/component/ElMenu/sub.vue +118 -0
- package/src/component/Hamburger/index.vue +27 -0
- package/src/component/Hamburger/style.scss +3 -0
- package/src/component/Header/index.vue +131 -0
- package/src/component/Header/style.scss +74 -0
- package/src/component/Header/theme-dark.scss +31 -0
- package/src/component/Header/theme-light.scss +15 -0
- package/src/component/HorizontalResizableMenu/GhostMenu.vue +101 -0
- package/src/component/HorizontalResizableMenu/index.vue +280 -0
- package/src/component/HorizontalScroller/index.vue +91 -0
- package/src/component/HorizontalScroller/style.scss +12 -0
- package/src/component/Layout/index.vue +153 -0
- package/src/component/Layout/style.scss +42 -0
- package/src/component/LoadingSpinner/index.vue +17 -0
- package/src/component/Logo/index.vue +41 -0
- package/src/component/Logo/style.scss +26 -0
- package/src/component/NavMenu/index.vue +206 -0
- package/src/component/NavMenu/style.scss +159 -0
- package/src/component/NavMenu/theme-dark.scss +59 -0
- package/src/component/NavMenu/theme-light.scss +81 -0
- package/src/component/Page/content.vue +58 -0
- package/src/component/Page/iframe.vue +63 -0
- package/src/component/Page/index.vue +22 -0
- package/src/component/Page/style.scss +48 -0
- package/src/component/Redirect/index.vue +19 -0
- package/src/component/TagsView/index.vue +255 -0
- package/src/component/TagsView/style.scss +51 -0
- package/src/component/TagsView/util.js +67 -0
- package/src/config/const.js +24 -0
- package/src/config/defaultRoute.js +23 -0
- package/src/config/index.js +4 -0
- package/src/config/logic.js +53 -0
- package/src/helper.js +43 -0
- package/src/index.js +15 -0
- package/src/mixin/menu.js +72 -0
- package/src/store/app.js +132 -0
- package/src/store/aside.js +92 -0
- package/src/store/header.js +37 -0
- package/src/store/index.js +20 -0
- package/src/store/page.js +67 -0
- package/src/store/tagsView.js +186 -0
- package/src/store/util.js +35 -0
- package/src/style/index.scss +23 -0
- package/src/style/maxViewHeight.scss +65 -0
- package/src/style/transition.scss +71 -0
- package/src/style/var.scss +81 -0
- package/src/util.js +69 -0
- package/types/config.d.ts +12 -0
- package/types/helper.d.ts +10 -0
- package/types/index.d.ts +5 -0
- package/types/menu.d.ts +17 -0
- package/types/route.d.ts +15 -0
- package/types/store.d.ts +156 -0
- package/types/vue-router.d.ts +7 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
.el-menu {
|
|
2
|
+
width: 100%;
|
|
3
|
+
border: none !important;
|
|
4
|
+
|
|
5
|
+
// 菜单图标
|
|
6
|
+
.menu-icon {
|
|
7
|
+
color: inherit;
|
|
8
|
+
font-size: 38px;
|
|
9
|
+
|
|
10
|
+
// 与菜单内容的间隔
|
|
11
|
+
& + * {
|
|
12
|
+
margin-left: $menu-icon-text-gap;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 子级菜单激活时,父级同样高亮
|
|
17
|
+
.el-menu-item.is-active,
|
|
18
|
+
.is-active > .el-submenu__title {
|
|
19
|
+
color: #f5714a !important;
|
|
20
|
+
background-color: #fff2e9;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// 弹出菜单
|
|
24
|
+
&--popup {
|
|
25
|
+
max-height: 88vh;
|
|
26
|
+
min-width: 160px;
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin-top: 5px;
|
|
29
|
+
margin-bottom: 5px;
|
|
30
|
+
overflow-y: auto;
|
|
31
|
+
|
|
32
|
+
// 弹出菜单的父级
|
|
33
|
+
.popover-menu__title {
|
|
34
|
+
height: 56px;
|
|
35
|
+
line-height: 56px;
|
|
36
|
+
padding: 0 $menu-padding;
|
|
37
|
+
font-size: $--menu-item-font-size;
|
|
38
|
+
cursor: auto;
|
|
39
|
+
border-bottom-width: 1px;
|
|
40
|
+
border-bottom-style: solid;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 桌面端不显示滚动条
|
|
45
|
+
@media (min-width: $max-mobile-width) {
|
|
46
|
+
&::-webkit-scrollbar {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//菜单hover时,左侧图标放大(弹出菜单的父级不放大)
|
|
53
|
+
.el-menu-item:not(.popover-menu__title),
|
|
54
|
+
.el-submenu__title {
|
|
55
|
+
> .menu-icon,
|
|
56
|
+
> .el-tooltip > .menu-icon {
|
|
57
|
+
transition: transform 0.1s;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:hover {
|
|
61
|
+
> .menu-icon,
|
|
62
|
+
> .el-tooltip > .menu-icon {
|
|
63
|
+
transform: scale(1.2);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.el-menu-item,
|
|
69
|
+
.el-submenu__title {
|
|
70
|
+
text-overflow: ellipsis;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
|
|
73
|
+
// 让文字不会超出右侧的展开折叠图标
|
|
74
|
+
padding-left: $menu-padding;
|
|
75
|
+
padding-right: 20px + 12px; // element-ui默认padding:20px以及图标font-size:12px
|
|
76
|
+
|
|
77
|
+
// 移除菜单hover、focus时的默认背景色,等同于修改$--menu-item-hover-fill
|
|
78
|
+
&:hover,
|
|
79
|
+
&:focus {
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 图标与字体同色
|
|
84
|
+
i {
|
|
85
|
+
color: inherit;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//原先右侧展开箭头偏上
|
|
90
|
+
.el-submenu__icon-arrow {
|
|
91
|
+
margin-top: -4px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
//侧边栏垂直菜单
|
|
95
|
+
.el-menu--vertical {
|
|
96
|
+
&.el-menu {
|
|
97
|
+
overflow-y: auto;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// 折叠时
|
|
101
|
+
&.el-menu--collapse {
|
|
102
|
+
.el-submenu__title {
|
|
103
|
+
padding-right: $menu-padding;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// 使用过渡动画会用span标签包裹,导致原始使用'>'选择器失效
|
|
107
|
+
.el-submenu > .el-submenu__title > .el-submenu__icon-arrow {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//顶部水平菜单
|
|
114
|
+
.el-menu--horizontal {
|
|
115
|
+
// 顶部菜单的顶级节点
|
|
116
|
+
&.el-menu {
|
|
117
|
+
// 不显示折叠展开按钮
|
|
118
|
+
&.hide-collapse-icon
|
|
119
|
+
> .el-submenu
|
|
120
|
+
> .el-submenu__title
|
|
121
|
+
> .el-submenu__icon-arrow {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// 顶级节点的高度以及hover时的下边框
|
|
126
|
+
> .el-menu-item,
|
|
127
|
+
> .el-submenu > .el-submenu__title {
|
|
128
|
+
height: $header-height;
|
|
129
|
+
line-height: $header-height;
|
|
130
|
+
|
|
131
|
+
&:hover {
|
|
132
|
+
border-bottom: 2px solid $--color-primary;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&.el-menu,
|
|
138
|
+
.el-menu {
|
|
139
|
+
// 菜单的文字以及hover颜色
|
|
140
|
+
.el-menu-item,
|
|
141
|
+
.el-submenu__title {
|
|
142
|
+
> span {
|
|
143
|
+
max-width: 100px;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// 移除背景色
|
|
149
|
+
> .el-menu-item:not(.is-disabled):hover,
|
|
150
|
+
> .el-menu-item:not(.is-disabled):focus,
|
|
151
|
+
> .el-submenu .el-submenu__title:hover,
|
|
152
|
+
.el-menu .el-menu-item,
|
|
153
|
+
.el-menu .el-submenu__title {
|
|
154
|
+
background-color: transparent !important;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@import "./theme-light";
|
|
159
|
+
@import "./theme-dark";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.el-menu--dark {
|
|
2
|
+
// 侧边栏垂直菜单
|
|
3
|
+
&.el-menu--vertical {
|
|
4
|
+
// 背景色
|
|
5
|
+
&.el-menu,
|
|
6
|
+
> .el-menu {
|
|
7
|
+
background-color: $menu-background-dark;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// 菜单的文字以及hover颜色
|
|
11
|
+
.el-menu-item,
|
|
12
|
+
.el-submenu__title {
|
|
13
|
+
color: $menu-text-color-dark;
|
|
14
|
+
|
|
15
|
+
&:hover {
|
|
16
|
+
color: $menu-text-hover-color-dark;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 设置了显示弹出菜单的父级
|
|
21
|
+
.el-menu--popup .popover-menu__title {
|
|
22
|
+
color: $menu-text-hover-color-dark;
|
|
23
|
+
border-bottom-color: $--border-color-dark;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 子级菜单的背景颜色和内阴影
|
|
27
|
+
.el-menu--inline {
|
|
28
|
+
background-color: $sub-menu-background-dark;
|
|
29
|
+
box-shadow: inset 0 2px 8px darken($sub-menu-background-dark, 10%)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 顶部水平菜单
|
|
34
|
+
&.el-menu--horizontal {
|
|
35
|
+
// 背景色
|
|
36
|
+
&.el-menu,
|
|
37
|
+
> .el-menu {
|
|
38
|
+
background-color: $header-background-dark;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 菜单的文字以及hover颜色
|
|
42
|
+
.el-menu-item,
|
|
43
|
+
.el-submenu__title {
|
|
44
|
+
color: $menu-text-color-dark;
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
color: $menu-text-hover-color-dark;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// hover时不显示下边框
|
|
52
|
+
&.el-menu {
|
|
53
|
+
> .el-menu-item,
|
|
54
|
+
> .el-submenu > .el-submenu__title {
|
|
55
|
+
border-bottom: none !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.collapse {
|
|
2
|
+
.el-submenu__title {
|
|
3
|
+
height: 100%;
|
|
4
|
+
padding-top: 15px;
|
|
5
|
+
padding-left: 25px;
|
|
6
|
+
padding-right: 23px;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.el-menu--light {
|
|
11
|
+
// 侧边栏垂直菜单
|
|
12
|
+
&.el-menu--vertical {
|
|
13
|
+
// 菜单的文字以及hover颜色
|
|
14
|
+
.el-menu-item,
|
|
15
|
+
.el-submenu__title {
|
|
16
|
+
color: $menu-text-color-light;
|
|
17
|
+
&:hover {
|
|
18
|
+
color: #f56d45;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 设置了显示弹出菜单的父级
|
|
23
|
+
.el-menu--popup .popover-menu__title {
|
|
24
|
+
color: $menu-text-color-light;
|
|
25
|
+
border-bottom-color: $--border-color-light;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// 模仿ant-design的亮色菜单
|
|
29
|
+
&:not(.el-menu--collapse) {
|
|
30
|
+
.el-menu-item {
|
|
31
|
+
// 小竖条
|
|
32
|
+
&::after {
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 10%;
|
|
35
|
+
right: 0;
|
|
36
|
+
height: 80%;
|
|
37
|
+
border-right: 3px solid $--color-primary;
|
|
38
|
+
opacity: 0;
|
|
39
|
+
transform: scaleY(0);
|
|
40
|
+
transition: transform 0.15s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
41
|
+
content: "";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.is-active {
|
|
45
|
+
// 背景色
|
|
46
|
+
&::before {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 10%;
|
|
49
|
+
left: 0;
|
|
50
|
+
height: 80%;
|
|
51
|
+
width: 100%;
|
|
52
|
+
content: "";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&::after {
|
|
56
|
+
opacity: 1;
|
|
57
|
+
transform: scaleY(1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 弹出菜单激活时不显示右边框
|
|
63
|
+
.el-menu--popup .el-menu-item::after {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 顶部水平菜单
|
|
70
|
+
&.el-menu--horizontal {
|
|
71
|
+
// 菜单的文字以及hover颜色
|
|
72
|
+
.el-menu-item,
|
|
73
|
+
.el-submenu__title {
|
|
74
|
+
color: $menu-text-color-light;
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
color: $menu-text-hover-color-light;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import CachedRouterView from '../../component/CachedRouterView'
|
|
3
|
+
import Breadcrumb from '../../component/Breadcrumb'
|
|
4
|
+
import { pageGetters } from '../../store'
|
|
5
|
+
|
|
6
|
+
const PageHeader = {
|
|
7
|
+
name: 'PageFooter',
|
|
8
|
+
|
|
9
|
+
render(h) {
|
|
10
|
+
return h('div', { staticClass: 'page-header' }, this.$slots.default)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const PageFooter = {
|
|
14
|
+
name: 'PageFooter',
|
|
15
|
+
|
|
16
|
+
render(h) {
|
|
17
|
+
return h('footer', { staticClass: 'page-footer' }, this.$slots.default)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'PageContent',
|
|
23
|
+
|
|
24
|
+
computed: {
|
|
25
|
+
showHeader() {
|
|
26
|
+
return pageGetters.showHeader && this.$route.meta.pageHeader !== false
|
|
27
|
+
},
|
|
28
|
+
showFooter() {
|
|
29
|
+
return pageGetters.showFooter && this.$route.meta.pageFooter !== false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
render(h) {
|
|
34
|
+
const { headerSlot, footerSlot } = pageGetters
|
|
35
|
+
const showFooter = this.showFooter && footerSlot
|
|
36
|
+
|
|
37
|
+
const className = {
|
|
38
|
+
'page-content': true,
|
|
39
|
+
'has-page-header': this.showHeader,
|
|
40
|
+
'has-page-footer': showFooter
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div class={className}>
|
|
45
|
+
{this.showHeader && (
|
|
46
|
+
<PageHeader>
|
|
47
|
+
{headerSlot ? headerSlot(h) : <Breadcrumb/>}
|
|
48
|
+
</PageHeader>
|
|
49
|
+
)}
|
|
50
|
+
|
|
51
|
+
<CachedRouterView class="page-view"/>
|
|
52
|
+
|
|
53
|
+
{showFooter && <PageFooter>{footerSlot(h)}</PageFooter>}
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-show="showIframe" class="page-iframe">
|
|
3
|
+
<iframe
|
|
4
|
+
v-for="src in iframeList"
|
|
5
|
+
v-show="src === currentIframe"
|
|
6
|
+
:id="src"
|
|
7
|
+
:key="src"
|
|
8
|
+
:src="src"
|
|
9
|
+
frameborder="0"
|
|
10
|
+
height="100%"
|
|
11
|
+
width="100%"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import { pageGetters, pageMutations, tagsViewGetters } from '../../store'
|
|
18
|
+
import { getRouterKey } from '../../config/logic'
|
|
19
|
+
import { isEmpty } from '../../util'
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'PageIframe',
|
|
23
|
+
|
|
24
|
+
computed: {
|
|
25
|
+
showIframe() {
|
|
26
|
+
return pageGetters.showIframe
|
|
27
|
+
},
|
|
28
|
+
iframeList() {
|
|
29
|
+
return pageGetters.iframeList
|
|
30
|
+
},
|
|
31
|
+
currentIframe() {
|
|
32
|
+
return pageGetters.currentIframe
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
watch: {
|
|
37
|
+
$route: {
|
|
38
|
+
handler(to, from) {
|
|
39
|
+
this.iframeCtrl(to, from)
|
|
40
|
+
},
|
|
41
|
+
immediate: true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
methods: {
|
|
46
|
+
// 路由跳转时控制iframe的显隐
|
|
47
|
+
iframeCtrl(to, from) {
|
|
48
|
+
// 从iframe页面离开时,判断是否需要删除iframe
|
|
49
|
+
if (from && from.meta.iframe) {
|
|
50
|
+
const key = getRouterKey(from)
|
|
51
|
+
const del = isEmpty(key) || !tagsViewGetters.cachedViews.includes(key)
|
|
52
|
+
|
|
53
|
+
pageMutations.closeIframe(from.meta.iframe, del)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 跳转至iframe页面时,打开iframe
|
|
57
|
+
if (to.meta.iframe) {
|
|
58
|
+
pageMutations.openIframe(to.meta.iframe)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<main class="page-main">
|
|
3
|
+
<page-content/>
|
|
4
|
+
|
|
5
|
+
<page-iframe/>
|
|
6
|
+
</main>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
/**
|
|
11
|
+
* 页面,拆成content、iframe、view等好几部分是为了避免额外渲染
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import PageIframe from './iframe'
|
|
15
|
+
import PageContent from './content'
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'Page',
|
|
19
|
+
|
|
20
|
+
components: { PageContent, PageIframe }
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.page-main {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
background-color: $page-background-color;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.page-iframe {
|
|
8
|
+
position: absolute;
|
|
9
|
+
z-index: 1;
|
|
10
|
+
top: 0;
|
|
11
|
+
left: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
background-color: $page-background-color; // iframe加载时遮住原始路由页面
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.page-content {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
height: 100%;
|
|
21
|
+
overflow: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.page-header {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
align-items: center;
|
|
28
|
+
height: $page-header-height;
|
|
29
|
+
padding: $page-header-padding $page-view-margin $page-header-padding $page-view-margin;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
|
|
32
|
+
// 页头渲染时页面顶部margin为0
|
|
33
|
+
& + .page-view {
|
|
34
|
+
margin-top: 0 !important;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.page-footer {
|
|
39
|
+
height: $page-footer-height;
|
|
40
|
+
padding: $page-view-margin;
|
|
41
|
+
text-align: center;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.page-view {
|
|
46
|
+
margin: $page-view-margin;
|
|
47
|
+
flex: 1;
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* 用于刷新路由的工具组件
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Const } from '../../config'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
mounted() {
|
|
10
|
+
const { fullPath } = this.$route
|
|
11
|
+
const to = fullPath.replace(new RegExp(Const.redirectPath, 'gm'), '')
|
|
12
|
+
|
|
13
|
+
// 如果路由没有component选项时(比如iframe路由),必须使用$nextTick模拟路由组件加载
|
|
14
|
+
this.$nextTick(() => this.$router.replace(to))
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
render: () => undefined
|
|
18
|
+
}
|
|
19
|
+
</script>
|