首次提交:初始化项目代码
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { createSSRApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
// 1. 引入主题核心方法
|
||||
import {
|
||||
THEME_PRESETS,
|
||||
switchTheme,
|
||||
getThemeConfigFromStorage,
|
||||
initTheme
|
||||
} from './utils/theme.js'
|
||||
|
||||
// 2. 导入主题混入文件
|
||||
import themeMixin from './mixins/themeMixin.js'
|
||||
|
||||
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
|
||||
// 注册全局混入
|
||||
app.mixin(themeMixin)
|
||||
|
||||
|
||||
// 挂载的全局主题方法
|
||||
app.config.globalProperties.$theme = {
|
||||
presets: THEME_PRESETS,
|
||||
switchTheme: switchTheme,
|
||||
getConfig: getThemeConfigFromStorage,
|
||||
initTheme: initTheme
|
||||
}
|
||||
|
||||
return { app }
|
||||
}
|
||||
Reference in New Issue
Block a user