Skip to content

Commit 0dc1bf3

Browse files
committed
添加强制刷新路由的provide方法
1 parent 652a73a commit 0dc1bf3

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

src/App.vue

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
22
<v-app id="app" :class="bgcClass" :style="curBgcStyle">
3-
<jse-header v-if="!hideHAF" />
3+
<jse-header v-show="!hideHAF" />
44
<section class="app-content" :class="hideHAF?'app-full-screen':''">
5-
<router-view />
5+
<router-view :key="routerKey" />
66
<jse-snackbar />
77
</section>
8-
<jse-footer v-if="!hideHAF" />
8+
<jse-footer v-show="!hideHAF" />
99
</v-app>
1010
</template>
1111

@@ -21,6 +21,14 @@ export default {
2121
return {
2222
bgcClass: '',
2323
curBgcStyle: {},
24+
routerKey: 0,
25+
}
26+
},
27+
provide() {
28+
return {
29+
changeRouterKey: () => {
30+
this.routerKey++
31+
},
2432
}
2533
},
2634
mounted() {
@@ -57,10 +65,7 @@ export default {
5765
this.curBgcStyle = {}
5866
let path = this.path
5967
const list = ['home', 'features', 'feedback']
60-
if (/^user/.test(path)) {
61-
this.bgcClass = 'user-bgc'
62-
this.curBgcStyle.backgroundImage = `linear-gradient(rgba(${this.curUserDetail.bgc},0.7) -50px,rgb(26,26,26) 300px)`
63-
} else if (list.includes(path)) {
68+
if (list.includes(path)) {
6469
this.bgcClass = `bgc-animation bgc-before ${path}-bgc`
6570
}
6671
},
@@ -80,6 +85,7 @@ export default {
8085
font-family: $font;
8186
background-color: $deep-5;
8287
position: relative;
88+
background-attachment: fixed;
8389
@include setTransition(all, 0.3s, ease);
8490
.app-content {
8591
min-height: calc(100vh - 70px);
@@ -91,24 +97,23 @@ export default {
9197
.bgc-animation {
9298
background-position: 50% 0;
9399
background-size: 200% !important;
94-
@include animation(background-fade, 0.5s, 0.3s, ease, forwards);
100+
// @include animation(background-fade, 0.5s, 0.3s, ease, forwards);
95101
}
96102
.bgc-before {
97103
&::before {
98104
content: '';
99105
width: 100%;
100106
height: 100%;
101-
backdrop-filter: blur(200px);
102107
position: absolute;
103108
}
104109
}
105110
.home-bgc {
106111
background-image: linear-gradient(
107112
135deg,
108-
$primary-1 0,
109-
$deep-2 10%,
110-
$deep-5 15%,
111-
$deep-6 25%
113+
#2050a1 -50px,
114+
#1c347c 20%,
115+
#1a1925 45%,
116+
$deep-6
112117
) !important;
113118
&:before {
114119
background-color: rgba(25, 128, 255, 0.1);
@@ -119,7 +124,7 @@ export default {
119124
135deg,
120125
$deep-1 0,
121126
$deep-2 15%,
122-
$deep-5 35%
127+
$deep-4 35%
123128
) !important;
124129
&:before {
125130
background-color: rgba(60, 60, 60, 0.1);

0 commit comments

Comments
 (0)