AssetManager.UniApp/main.js

36 lines
674 B
JavaScript
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 uView from 'uview-ui'
console.log('🚀 应用启动导入api模块')
export function createApp() {
const app = createSSRApp(App)
// 全局注册api
app.config.globalProperties.$api = api
console.log('✅ api已全局注册为 $api')
// 注册uView UI 2.0
app.use(uView)
console.log('✅ uView UI 2.0 已全局注册')
return {
app
}
}
// #endif