Blame view

src/main.js 2.1 KB
1
/*
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-06-20 10:02:14
5
 */
赵千 committed
6 7 8
import Vue from 'vue'
import App from './App'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
xiaomiao committed
9
import Element, { install } from 'element-ui'
10
import axios from 'axios'
任超 committed
11
import '@/styles/element-variables.scss'
任超 committed
12
import '@/styles/index.scss'
任超 committed
13
import Base from '@/components/Base/base' // 全局组件引入
任超 committed
14
import mixin from '@/utils/mixin/theme.js'
15
import Loading from '@/components/Loading/index.js';
xiaomiao committed
16
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
任超 committed
17
import { startLoadingAddCount, endLoadingSubCount } from './utils/requestLoading'
任超 committed
18
Vue.mixin(mixin);
19
Vue.use(Loading.directive);
xiaomiao committed
20

21 22 23
// 引入xml
import x2js from 'x2js'
Vue.prototype.$x2js = new x2js()
任超 committed
24
// 全局方法挂载
任超 committed
25 26 27
// 全局加载
Vue.prototype.$startLoading = startLoadingAddCount
Vue.prototype.$endLoading = endLoadingSubCount
任超 committed
28 29 30 31 32

// 弹框
import { popupDialog, popupCacel } from "./utils/popup.js";
// 全局加载
Vue.prototype.$popupDialog = popupDialog
xiaomiao committed
33
Vue.prototype.$popupCacel = popupCacel
任超 committed
34 35


任超 committed
36 37
import { theme } from "@/directive/theme.js"
Vue.directive("theme", theme)
任超 committed
38 39 40 41 42
Vue.directive('fo', {
    inserted (el, binding, vnode) {
        el.querySelector('input').focus()
    }
})
任超 committed
43
import './image/icons' // icon
赵千 committed
44 45 46 47
import store from './store'
import router from './router'
import _ from 'lodash'

任超 committed
48
import VueQuillEditor from 'vue-quill-editor'//调用编辑器
蔡俊立 committed
49 50 51 52 53 54
// 样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)

赵千 committed
55
import * as filters from './filters' // global filters
任超 committed
56
Vue.use(Element, { size: 'small', zIndex: 1000 })
任超 committed
57
Vue.use(Base)
赵千 committed
58 59 60 61
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})
Vue.config.productionTip = false
62

63
axios.get("/config.json")
64 65 66 67 68 69 70 71 72 73 74 75
    .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)
        })
    })