import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import Store from './store'
import { initLocale } from '@/locales/i18n'
import NavBar from '@/components/layout/nav-bar'
import UScrollView from '@/components/common/u-scroll-view'
import UPanel from '@/components/common/u-panel'
import USearch from '@/components/common/u-search'
import USwiper from '@/components/common/u-swiper'
import UDropdownSelect from '@/components/common/u-dropdown-select'
import UTabs from '@/components/common/u-tabs'

import './uni.promisify.adaptor'
Vue.config.productionTip = false
Vue.prototype.$config = {
	pageHeight: 0
}
Vue.prototype.onInitNavbar = function(e) {
	this.$config.pageHeight = e.detail.pageHeight
	console.log("this.$config.pageHeight")
	console.log(this.$config.pageHeight)
}
// 自定义公供组件
Vue.component('NavBar', NavBar)
Vue.component('UScrollView', UScrollView)
Vue.component('UPanel', UPanel)
Vue.component('USearch', USearch)
Vue.component('USwiper', USwiper)
Vue.component('UDropdownSelect', UDropdownSelect)
Vue.component('UTabs', UTabs)

App.mpType = 'app'
const app = new Vue({
	App,
	Store
})
app.$mount()

initLocale()
// #endif

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