Skip to content

Commit 8a1902e

Browse files
committed
VERSION 1.08 fix loading page
1 parent 6a4fa1b commit 8a1902e

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

components/Common.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default {
5959
isSidebarOpen: false,
6060
isHasKey: true,
6161
isHasPageKey: true,
62-
firstLoad: false
62+
firstLoad: true
6363
}
6464
},
6565
@@ -113,22 +113,14 @@ export default {
113113
}
114114
},
115115
116-
created () {
117-
this.firstLoad = sessionStorage.getItem('firstLoad') == undefined
118-
},
119-
120116
mounted () {
121117
this.$router.afterEach(() => {
122118
this.isSidebarOpen = false
123119
})
124120
125121
this.hasKey()
126122
this.hasPageKey()
127-
setTimeout(() => {
128-
this.firstLoad = false
129-
sessionStorage.setItem('firstLoad', false)
130-
}, 2000)
131-
123+
this.handleLoading()
132124
},
133125
134126
methods: {
@@ -173,6 +165,14 @@ export default {
173165
this.toggleSidebar(false)
174166
}
175167
}
168+
},
169+
170+
handleLoading () {
171+
const time = this.$frontmatter.home && sessionStorage.getItem('firstLoad') == undefined ? 1000 : 0
172+
setTimeout(() => {
173+
this.firstLoad = false
174+
if (sessionStorage.getItem('firstLoad') == undefined) sessionStorage.setItem('firstLoad', false)
175+
}, time)
176176
}
177177
},
178178

components/Loading.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div v-for="item in 4" :key="`out${item}`">
55
</div>
66
</div>
7-
<h3 class="title">Welcome {{$site.title}}</h3>
7+
<h3 class="title" v-if="$frontmatter.home">Welcome {{$site.title}}</h3>
88
<p class="description">Just wait a minute!</p>
99
</div>
1010
</template>
@@ -19,8 +19,6 @@ export default {
1919
#loader-wrapper{
2020
height:100vh;
2121
width:100vw;
22-
// background:#888;
23-
// background-image: radial-gradient(at center top, $accentColor 0px, rgb(0, 1, 5) 100%);
2422
.loader-main{
2523
position:fixed;
2624
width:120px;
@@ -54,7 +52,7 @@ export default {
5452
border-radius:25px;
5553
animation:rotate_pacman_half_down 0.5s 0s infinite;
5654
margin-top:-50px;}
57-
&:nth-child(3), &:nth-child(4), &:nth-child(5), &:nth-child(6){
55+
&:nth-child(3),&:nth-child(4),&:nth-child(5),&:nth-child(6){
5856
background-color:$accentColor;
5957
width:15px;
6058
height:15px;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-theme-reco",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "this is a vuepress theme",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)