62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
|
|
import Vue from 'vue'
|
||
|
|
import * as filters from './filters'
|
||
|
|
import * as directives from './directives'
|
||
|
|
import 'remixicon/fonts/remixicon.css' //remixicon 图标库
|
||
|
|
import '@/utils/flexible'
|
||
|
|
import '@/fonts/digiface/digiface.css' // 电子字体
|
||
|
|
import '@/fonts/iconfont/iconfont.css' // 内部图表库
|
||
|
|
import elementUI from 'element-ui'
|
||
|
|
import '@/styles/index.scss' // 全局样式
|
||
|
|
import '@/styles/dt-ui.css' // 全局样式
|
||
|
|
import resetMessage from '@/utils/message';
|
||
|
|
import Card from '@/components/card/index.vue'
|
||
|
|
import Dialog from '@/components/dialog/index.vue'
|
||
|
|
import Loading from '@/components/loading/index.vue'
|
||
|
|
import Container from '@/components/container/index.vue'
|
||
|
|
|
||
|
|
|
||
|
|
const hub = new Vue()
|
||
|
|
|
||
|
|
class AppLoader {
|
||
|
|
constructor() {
|
||
|
|
Vue.config.productionTip = false
|
||
|
|
Vue.prototype.$singleMessage = resetMessage;
|
||
|
|
Vue.component('DtCard', Card)
|
||
|
|
Vue.component('DtLoading', Loading)
|
||
|
|
Vue.component('DtDialog', Dialog)
|
||
|
|
Vue.component('DtContainer', Container)
|
||
|
|
Vue.use(elementUI)
|
||
|
|
Vue.use({
|
||
|
|
install(Vue) {
|
||
|
|
Vue.prototype.$hub = hub
|
||
|
|
}
|
||
|
|
})
|
||
|
|
Vue.prototype.$eventBus = new Vue(); // 全局事件
|
||
|
|
/**
|
||
|
|
* 注册过滤器
|
||
|
|
*/
|
||
|
|
Object.keys(filters).forEach(key => {
|
||
|
|
Vue.filter(key, filters[key])
|
||
|
|
})
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 注册指令
|
||
|
|
*/
|
||
|
|
Object.keys(directives).forEach(key => {
|
||
|
|
Vue.use(directives[key])
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
install() {
|
||
|
|
try {
|
||
|
|
global.Vue = Vue
|
||
|
|
} catch (error) {
|
||
|
|
console.log(error.message)
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const appLoader = new AppLoader()
|
||
|
|
export default appLoader
|