main.js
2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-20 10:02:14
*/
import Vue from 'vue'
import App from './App'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element, { install } from 'element-ui'
import axios from 'axios'
import '@/styles/element-variables.scss'
import '@/styles/index.scss'
import Base from '@/components/Base/base' // 全局组件引入
import mixin from '@/utils/mixin/theme.js'
import Loading from '@/components/Loading/index.js';
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { startLoadingAddCount, endLoadingSubCount } from './utils/requestLoading'
import Print from 'vue-print-nb'
Vue.use(Print);
Vue.mixin(mixin);
Vue.use(Loading.directive);
// 引入xml
import x2js from 'x2js'
Vue.prototype.$x2js = new x2js()
// 全局方法挂载
// 全局加载
Vue.prototype.$startLoading = startLoadingAddCount
Vue.prototype.$endLoading = endLoadingSubCount
// 弹框
import { popupDialog, popupCacel } from "./utils/popup.js";
// 全局加载
Vue.prototype.$popupDialog = popupDialog
Vue.prototype.$popupCacel = popupCacel
import { theme } from "@/directive/theme.js"
Vue.directive("theme", theme)
Vue.directive('fo', {
inserted (el, binding, vnode) {
el.querySelector('input').focus()
}
})
import './image/icons' // icon
import store from './store'
import router from './router'
import _ from 'lodash'
import VueQuillEditor from 'vue-quill-editor'//调用编辑器
// 样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)
import * as filters from './filters' // global filters
Vue.use(Element, { size: 'small', zIndex: 1000 })
Vue.use(Base)
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
Vue.config.productionTip = false
axios.get("/config.json")
.then((res) => {
Vue.prototype.BASE_API = res.data
localStorage.setItem('ApiUrl', JSON.stringify(res.data));
window.TITLE = res.data.TITLE
require('./permission')
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
})