main.js 1.53 KB
import Vue from 'vue'
import App from './App'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui'
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 { startLoadingAddCount, endLoadingSubCount } from './utils/requestLoading'
Vue.mixin(mixin);
Vue.use(Loading.directive);
import rules from './utils/rule.js'
// 全局方法挂载
Vue.prototype.$rules = rules
// 全局加载
Vue.prototype.$startLoading = startLoadingAddCount
Vue.prototype.$endLoading = endLoadingSubCount
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
import './permission' // permission control
Vue.use(Element, { size: 'small', zIndex: 1000 })
Vue.use(Base)
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})
Vue.config.productionTip = false
new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
})