import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import store from '@/store'
import uView from '@/plugins/uview-ui'
import '@/utils/preCheck.js'
import '@/utils/prototype.js'
import platform from "@/utils/platform" // 平台判断方法
import getEnv from "@/utils/env" // 获取环境变量
import mixin from "mixins/global.js"

Vue.use(uView)

Vue.config.productionTip = false
App.mpType = 'app'
Vue.prototype.$store = store
Vue.prototype.$platform = platform()
Vue.prototype.$ENV = getEnv()
Vue.mixin(mixin)

if (platform() === 'H5' && getEnv() !== 'prod') {
	const vconsole = require('vconsole')
	Vue.prototype.$vconsole = new vconsole() // 使用vconsole
}

const app = new Vue({
	store,
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif