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

import constants from '@/constant/index'
Vue.prototype.$constant = constants
import './static/iconfont/iconfont.css'
import '@/filters/index'
// vue 指令
// import directives from '@/directives/isShow'
// import directives from '@/directives/index'
// Vue.use(directives)

// 全局bus事件
// Vue.prototype.$eventBus = new Vue()

import util from './utils/util'
Vue.prototype.$util = util

// import commonJS from './utils/common'
// Vue.prototype.commonJS = commonJS

import globalMixins from './mixins/globalMixins'
Vue.mixin(globalMixins)

// 阻止启动生产消息，常用作指令
Vue.config.productionTip = false

import store from './store'
Vue.prototype.$store = store

// 封装得全局消息提示
Vue.prototype.$msg = (title) => (
	uni.showToast({
		title,
		icon: 'none'
	})
)

// 生产环境中控制台不打印普通信息，以免造成内存泄漏
if (process.env.NODE_ENV == 'production') {
	if (console) {
		console.log = () => {}
	}
}

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