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