zxl
4 天以前 874e9cce3b2f9b6649ab72047d98e4244a345b3c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import App from './App'
 
import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
 
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
 
// 全局注册 vform 组件
Vue.component('uni-icons', uniIcons)
Vue.component('uni-datetime-picker', uniDatetimePicker)
Vue.config.productionTip = false
App.mpType = 'app'
App.appName = 'test'
const app = new Vue({
  ...App
})
app.$mount()
// #endif
 
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  // 在 Vue3 分支全局注册 uni-icons,兜底保证组件可用
  app.component('uni-icons', uniIcons)
  app.component('uni-datetime-picker', uniDatetimePicker)
  return {
    app
  }
}
// #endif