mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-28 02:51:56 +08:00
fix(build): wrap top-level await in async function for browser compatibility
This commit is contained in:
14
src/main.ts
14
src/main.ts
@@ -33,12 +33,14 @@ import { fetchGlobalSettings } from './api'
|
||||
// 创建Vue实例
|
||||
const app = createApp(App)
|
||||
|
||||
try {
|
||||
const globalSettings = await fetchGlobalSettings()
|
||||
// 使用 provide 传递全局设置
|
||||
app.provide('globalSettings', globalSettings)
|
||||
} catch (error) {
|
||||
console.error('Failed to initialize app', error)
|
||||
async function initializeApp() {
|
||||
try {
|
||||
const globalSettings = await fetchGlobalSettings()
|
||||
// 使用 provide 传递全局设置
|
||||
app.provide('globalSettings', globalSettings)
|
||||
} catch (error) {
|
||||
console.error('Failed to initialize app', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 注册全局组件
|
||||
|
||||
Reference in New Issue
Block a user