|
@@ -40,6 +40,32 @@ if (isWechat) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const loadSplash = (onload?: any, onerror?: any) =>
|
|
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
|
|
+ let isHide = false
|
|
|
|
|
+ function hideSplash() {
|
|
|
|
|
+ if (isHide) return
|
|
|
|
|
+ isHide = true
|
|
|
|
|
+ if (splash && !splash.hasAttribute('isHold')) {
|
|
|
|
|
+ splash.style.opacity = '0'
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ if (!splash.hasAttribute('isHold')) {
|
|
|
|
|
+ splash.style.display = 'none'
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 800)
|
|
|
|
|
+ }
|
|
|
|
|
+ resolve('')
|
|
|
|
|
+ }
|
|
|
|
|
+ const splash = document.getElementById('splash-screen')
|
|
|
|
|
+ if (splash) {
|
|
|
|
|
+ splash.style.opacity = '1'
|
|
|
|
|
+ splash.style.display = 'block'
|
|
|
|
|
+ }
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ hideSplash()
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
async function bootstrap() {
|
|
async function bootstrap() {
|
|
|
const app = createApp(App)
|
|
const app = createApp(App)
|
|
|
setupAssets()
|
|
setupAssets()
|
|
@@ -51,6 +77,7 @@ async function bootstrap() {
|
|
|
setupI18n(app)
|
|
setupI18n(app)
|
|
|
|
|
|
|
|
await setupRouter(app)
|
|
await setupRouter(app)
|
|
|
|
|
+ await loadSplash()
|
|
|
|
|
|
|
|
app.mount('#app')
|
|
app.mount('#app')
|
|
|
}
|
|
}
|