import Vue from 'vue'
import commonMethods from '@/common/commonMethods.js'
import commonData from '@/common/commonData.js'
import App from './App'
import store from './store/index.js'

import floatTab from '@/components/float-tab.vue'
import cuCustom from './components/cu-custom.vue'
import pageLoading from './components/page-loading.vue'
import mpTabbar from './components/mp-tabbar.vue'
import mixin from '@/common/utils/mixin.js'
Vue.mixin(mixin)
Vue.component('cu-custom', cuCustom)
Vue.component('page-loading', pageLoading)
Vue.component('mp-tabbar', mpTabbar)
Vue.component('float-tab', floatTab)

// 公共方法挂载在vue原型上
for (const key in commonMethods) {
  Vue.prototype[key] = commonMethods[key]
}

// 公共方法挂载在vue原型上
for (const key in commonData) {
  Vue.prototype[key] = commonData[key]
}

Vue.config.productionTip = false
// 需要全局注册一下store
Vue.prototype.$store = store
App.mpType = 'app'

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