import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import mixin from './utils/mixin'
Vue.prototype.$bus = new Vue()
// 进行全局混入
Vue.mixin(mixin)
new Vue({
store,
router,
render: h => h(App),
}).$mount('#app')
import filters from './filters'
import globalMethods from './global-methods'
import Config from '../config'
import CONSTANT from './const_var'
// 全局混入
export default {data() {
return {
CONFIG: Config,
CONSTANT,
}
},
methods: {
// // 将 globalMethods 文件外面的办法挂载到 vue 上, 以不便调用,间接 this.$xxx 办法名就能够了
// Object.keys(globalMethods).forEach(key => {// Vue.prototype[key] = tools[key]
// })
// 将 globalMethods 外面的办法用对象开展符混入到 mixin 上, 以不便调用,间接 this.$xxx 办法名就能够了
...globalMethods,
},
filters: {
// // 将 filter 外面的办法增加了 vue 的筛选器上
// Object.keys(filters).forEach(key => {// Vue.filter(key, filters[key])
// })
...filters,
},
}
export default {
// 工夫转换器
date(v) {...},
// 解决身份证信息,两头暗藏掉
processIdNumber(v) {...},
}
import {Message, MessageBox} from 'element-ui'
export default {$success(msg) {...},
$warning(msg) {...},
$error(msg) {...},
$checkPlatform() {...},
// 倒计时工夫格式化
$countdownFormatTime(timeStamp) {...},
}
export default {
REDIRECT: 'redirect',
// 申请办法
POST: 'post',
GET: 'get',
PATCH: 'patch',
DELETE: 'delete',
PUT: 'put',
// 动态常量
PICKEROPTIONS: {...},
PAGENUMBER: 1,
PAGESIZE: 10,
DELAYTIME: 250,
SUCCESS: '000000',
}