AssetManager.UniApp/main.js
claw_bot 7034a55c32 fix: 切换回uview-plus以兼容Vue3
- 卸载uview-ui 2.0 (仅支持Vue2)
- 安装uview-plus 3.7.13 (Vue3兼容版)
- 更新main.js导入为uview-plus
- 更新uni.scss样式引入路径
- 更新pages.json easycom配置
- 更新vite.config.js optimizeDeps
2026-03-13 03:13:56 +00:00

36 lines
696 B
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import App from './App'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
import api from './utils/api'
import uviewPlus from 'uview-plus'
console.log('🚀 应用启动导入api模块')
export function createApp() {
const app = createSSRApp(App)
// 全局注册api
app.config.globalProperties.$api = api
console.log('✅ api已全局注册为 $api')
// 注册uview-plus (Vue3兼容版)
app.use(uviewPlus)
console.log('✅ uview-plus 已全局注册')
return {
app
}
}
// #endif