| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- // The Vue build version to load with the `import` command
- // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
- import Vue from 'vue'
- import ElementUI from 'element-ui'
- import 'element-ui/lib/theme-chalk/index.css'
- import App from './App'
- import router from './router'
- // import axios from 'axios'
- import axios from './utils/axiosPlugin'
- import errorInfo from './utils/errorCode'
- import webSocketService from './utils/websocket';
- import './utils/loginTimeOut'; // 增加的超时登录退出的js
- Vue.use(ElementUI)
- Vue.prototype.$webSocket = webSocketService;
- Vue.config.productionTip = false
- Vue.prototype.$axios = axios
- Vue.directive('clickoutside', {
- bind (el, binding, vnode) {
- function documentHandler (e) {
- if (el.contains(e.target)) {
- return false
- }
- if (binding.expression) {
- binding.value(e)
- }
- }
- el.__vueClickOutside__ = documentHandler
- document.addEventListener('click', documentHandler)
- },
- unbind (el, binding) {
- document.removeEventListener('click', el.__vueClickOutside__)
- delete el.__vueClickOutside__
- }
- })
- /* eslint-disable no-new */
- const appVue = new Vue({
- el: '#app',
- render: h => h(App),
- router,
- components: {App},
- template: '<App/>'
- })
|