前端初始化

This commit is contained in:
zer0Black
2022-08-31 13:33:52 +08:00
commit 0a11097b80
108 changed files with 14283 additions and 0 deletions
+73
View File
@@ -0,0 +1,73 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import config from "@/utils/config";
// VXETable
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
// ElementUI
import ElementUI from 'element-ui';
import './assets/css/element-variables.scss'
// ECharts
import 'echarts'
import ECharts from './components/ECharts';
// Api
import Api from './api'
// 自定义指令
import Directive from './directives'
// 自定义过滤器
import Filter from './filters'
// 加密函数
import JSEncrypt from '../src/assets/js/jsencrypt.min.js';
VXETable.setup({
table: {
resizable: true,
}
})
Vue.use(VXETable);
// 富文本引用
import VueQuillEditor from 'vue-quill-editor'
// require styles 引入样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)
Vue.use(ElementUI, {size: 'mini', zIndex: 3000});
Vue.component('v-chart', ECharts);
Vue.use(Api);
Vue.use(Directive);
Vue.use(Filter);
Vue.prototype.$JSEncrypt = (data) => {
if(data === ''){
return '';
}
let encryptor = new JSEncrypt();
encryptor.setPublicKey(config.PUBLIC_KEY);
return encryptor.encrypt(data) || '';
}
VXETable.renderer.add('NotData', {
// 空内容模板
renderEmpty (h, renderOpts) {
return [
<span>
<img width="100" src={require('./assets/imgs/icon-nodata.png')}/>
<p style="margin-top: 10px;">暂无数据</p>
</span>
]
}
})
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')