mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-09 09:46:44 +08:00
Merge pull request #174 from InfinityPacer/dev
This commit is contained in:
+9
-5
@@ -33,16 +33,19 @@ import { fetchGlobalSettings } from './api'
|
|||||||
// 创建Vue实例
|
// 创建Vue实例
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
try {
|
async function initializeApp() {
|
||||||
|
try {
|
||||||
const globalSettings = await fetchGlobalSettings()
|
const globalSettings = await fetchGlobalSettings()
|
||||||
// 使用 provide 传递全局设置
|
// 使用 provide 传递全局设置
|
||||||
app.provide('globalSettings', globalSettings)
|
app.provide('globalSettings', globalSettings)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to initialize app', error)
|
console.error('Failed to initialize app', error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注册全局组件
|
// 注册全局组件
|
||||||
app
|
initializeApp().then(() => {
|
||||||
|
app
|
||||||
.component('VAceEditor', VAceEditor)
|
.component('VAceEditor', VAceEditor)
|
||||||
.component('VApexChart', VueApexCharts)
|
.component('VApexChart', VueApexCharts)
|
||||||
.component('VDialogCloseBtn', DialogCloseBtn)
|
.component('VDialogCloseBtn', DialogCloseBtn)
|
||||||
@@ -56,8 +59,8 @@ app
|
|||||||
.component('VTreeview', VTreeview)
|
.component('VTreeview', VTreeview)
|
||||||
.component('VPathField', PathField)
|
.component('VPathField', PathField)
|
||||||
|
|
||||||
// 注册插件
|
// 注册插件
|
||||||
app
|
app
|
||||||
.use(vuetify)
|
.use(vuetify)
|
||||||
.use(router)
|
.use(router)
|
||||||
.use(store)
|
.use(store)
|
||||||
@@ -88,3 +91,4 @@ app
|
|||||||
.use(VueApexCharts)
|
.use(VueApexCharts)
|
||||||
.mount('#app')
|
.mount('#app')
|
||||||
.$nextTick(() => removeEl('#loading-bg'))
|
.$nextTick(() => removeEl('#loading-bg'))
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user