import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false	

import config from "./config.js"

Vue.prototype.$config = config

import uView from "uview-ui";
Vue.use(uView);

App.mpType = 'app'

Vue.prototype.$offset = function(selector) { // 获取元素宽高位置信息
	return new Promise((resolve, reject) => {
		uni.createSelectorQuery().in(this).select(selector).boundingClientRect(data => {
			data ? data.x = data.left + data.width / 2 : ''
			data ? data.y = data.top + data.height / 2 : ''
			// data ? resolve(data) : reject('元素不存在')
		}).exec()
	})
}

import * as filters from '@/filters'
Object.keys(filters).forEach(e => {
	Vue.filter(e, filters[e])
})

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