You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

70 lines
1.7 KiB

import Vue from 'vue';
import App from '@/App.vue';
import router from '@/router';
import ElementUI from 'element-ui';
import '@/styles/index.scss'
import "@/styles/system.scss"
import mixinApp from '@/mixins/app';
import 'babel-polyfill';
import '@/libs/resize';
import {post,get,del,put} from '@/plugins/requests/index.js';
import api from '@/api';
import store from '@/store'
import Setting from '@/setting';
import permission from '@/router/permission';
import "tailwindcss/tailwind.css"
import VueLazyload from 'vue-lazyload';
// 插件
import plugins from '@/plugins';
import filters from '@/plugins/filters'
import axios from 'axios'
Vue.prototype.$axios = axios
Vue.directive('focus', {/* 聚焦事件 */
inserted: function (el, binding) {
if (el.parentNode.querySelector('input').disabled === false) {
el.parentNode.querySelector('input').focus()
}
}
})
Vue.directive('throttle', {/* 节流 */
inserted: function (el, binding) {
el.addEventListener('click', () => {
if (!el.disabled) {
el.disabled = true
setTimeout(() => {
el.disabled = false
}, binding.value || 3000)
}
})
}
});
Vue.use(plugins);
Vue.use(VueLazyload, {
preLoad: 1.3,
// loading: require('@/assets/img/loading.gif'),
attempt: 2
})
Object.keys(filters).forEach(item => Vue.filter(item,filters[item]))
Vue.prototype.api = api;
Vue.prototype.$get = get;
Vue.prototype.$post = post;
Vue.prototype.$del = del;
Vue.prototype.$put = put;
Vue.config.productionTip = false;
Vue.use(ElementUI);
new Vue({
mixins: [mixinApp],
router,
store,
render: h => h(App)
}).$mount('#app');