mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 00:36:41 +08:00
优化首次载入方式
This commit is contained in:
+1
-1
@@ -30,6 +30,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<div id="app">
|
||||||
<div id="loading-bg">
|
<div id="loading-bg">
|
||||||
<div class="loading-logo">
|
<div class="loading-logo">
|
||||||
<!-- Logo -->
|
<!-- Logo -->
|
||||||
@@ -144,7 +145,6 @@
|
|||||||
<div class="effect-3 effects"></div>
|
<div class="effect-3 effects"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="app">
|
|
||||||
</div>
|
</div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
+5
-6
@@ -28,7 +28,7 @@ app.use(vuetify)
|
|||||||
.use(ToastPlugin, {
|
.use(ToastPlugin, {
|
||||||
position: 'bottom-right',
|
position: 'bottom-right',
|
||||||
})
|
})
|
||||||
.use(VuetifyUseDialog).mount('#app')
|
.use(VuetifyUseDialog)
|
||||||
|
|
||||||
// 路由导航守卫
|
// 路由导航守卫
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
@@ -48,11 +48,10 @@ let isFirstApp: Boolean = true
|
|||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
doneNProgress()
|
doneNProgress()
|
||||||
if (isFirstApp) {
|
if (isFirstApp) {
|
||||||
// 标记首次载入完成, 再隐藏loading页面, 让首次载入更加丝滑
|
// 标记首次载入完成, 再绑定app
|
||||||
isFirstApp = false
|
isFirstApp = false
|
||||||
const loading_bg = document.getElementById('loading-bg')
|
setTimeout(() => {
|
||||||
if (loading_bg)
|
app.mount('#app')
|
||||||
// 或许这里需要再多加一点延迟才能改善ios的bug
|
}, 300)
|
||||||
document.body.removeChild(loading_bg)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user