删除elementui 改用cdn方式加载

This commit is contained in:
zyy 2019-11-14 14:10:20 +08:00
parent f31026608a
commit 558f359c77
10 changed files with 72 additions and 71 deletions

View File

@ -16,7 +16,6 @@
},
"dependencies": {
"axios": "0.18.0",
"element-ui": "2.7.2",
"file-saver": "^1.3.3",
"js-cookie": "2.2.0",
"js-md5": "^0.7.3",

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<!-- <link rel="stylesheet" href="https://cdn.bootcss.com/element-ui/2.12.0/theme-chalk/index.css"> -->
<link rel="stylesheet" href="https://cdn.bootcss.com/element-ui/2.12.0/theme-chalk/index.css">
<link href="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
<title><%= webpackConfig.name %></title>
<script src="/static/inflate.min.js"></script>
@ -17,9 +17,9 @@
<script src="https://cdn.bootcss.com/vue-router/3.0.6/vue-router.min.js"></script>
<script src="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.js"></script>
<!-- <script src="https://cdn.bootcss.com/element-ui/2.12.0/index.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.12.0/index.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.12.0/locale/en.min.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.12.0/locale/zh-CN.min.js"></script> -->
<script src="https://cdn.bootcss.com/element-ui/2.12.0/locale/zh-CN.min.js"></script>
</head>
<body>
<noscript>

View File

@ -1,4 +1,5 @@
import enLocale from 'element-ui/lib/locale/lang/en';
// import enLocale from 'element-ui/lib/locale/lang/en';
import ELEMENT from 'element-ui';
import map from './map';
import global from './global';
import router from './router';
@ -30,7 +31,7 @@ import login from './login';
import designPlatform from './designPlatform';
export default {
...enLocale,
...ELEMENT.lang.en,
map,
global,
router,

View File

@ -1,4 +1,5 @@
import cnLocale from 'element-ui/lib/locale/lang/zh-CN';
// import cnLocale from 'element-ui/lib/locale/lang/zh-CN';
import ELEMENT from 'element-ui';
import map from './map';
import global from './global';
import router from './router';
@ -30,7 +31,7 @@ import login from './login';
import designPlatform from './designPlatform';
export default {
...cnLocale,
...ELEMENT.lang.zhCN,
map,
global,
router,

View File

@ -1,10 +1,7 @@
import Vue from 'vue';
import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
import ElementUI from 'element-ui';
import ElementLocale from 'element-ui/lib/locale';
import 'element-ui/lib/theme-chalk/index.css';
import ELEMENT from 'element-ui';
import '@/styles/index.scss'; // global css
@ -26,7 +23,7 @@ import '@/directive/quickMenuDrag/index.js';
import '@/directive/waves/index.js';
import messages from '@/i18n/index';
Vue.use(ElementUI);
Vue.use(ELEMENT);
Vue.use(VueI18n);
Vue.config.productionTip = false;
@ -36,7 +33,7 @@ export const i18n = new VueI18n({
messages
});
ElementLocale.i18n((key, value) => i18n.t(key, value));
ELEMENT.i18n((key, value) => i18n.t(key, value));
new Vue({
el: '#app',

View File

@ -30,6 +30,7 @@ const ExistingSimulation = () => import('@/views/system/existingSimulation/index
const CacheControl = () => import('@/views/system/cacheControl/index');
const SystemGenerate = () => import('@/views/system/systemGenerate/index');
const IbpDraw = () => import('@/views/system/ibpDraw/index');
const News = () => import('@/views/system/news/index');
const Mapedit = () => import('@/views/mapdraft/index');
@ -99,7 +100,6 @@ const UserRulesDetail = () => import('@/views/orderauthor/rules/detail');
const LessonApproval = () => import('@/views/approval/lesson/index');
const ScriptApproval = () => import('@/views/approval/script/index');
const RunPlanApproval = () => import('@/views/approval/runPlan/index');
const News = () => import('@/views/news/index');
import { loginTitle } from '@/scripts/ConstDic';
import { getSessionStorage } from '@/utils/auth';

View File

@ -15,6 +15,7 @@ import { Notification } from 'element-ui';
import { runDiagramIsStart, runDiagramGetTime, runDiagramOver, runDiagramStart } from '@/api/simulation';
import { timeFormat } from '@/utils/date';
//
export default {
name: 'MenuPlan',
components: {

View File

@ -16,6 +16,7 @@
import { prefixIntrger } from '@/utils/date';
import SystemTime from '@/views/components/systemTime/index';
//
export default {
name: 'MenuSystemTime',
components: {

View File

@ -81,7 +81,8 @@ module.exports = {
'vuex': 'Vuex',
'vue-router': 'VueRouter',
'nprogress': 'NProgress',
'echarts': 'echarts'
'echarts': 'echarts',
'element-ui': 'ELEMENT'
};
},
@ -144,39 +145,39 @@ module.exports = {
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
},
// elementUI: {
// name: 'chunk-elementUI', // split elementUI into a single package
// priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
// test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
// },
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
},
jmap: {
name: 'chunk-jmap',
test: resolve('src/jmap'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
},
jlmap3d: {
name: 'chunk-jlmap3d',
test: resolve('src/jlmap3d'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
},
ibp: {
name: 'chunk-ibp',
test: resolve('src/ibp'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
// jmap: {
// name: 'chunk-jmap',
// test: resolve('src/jmap'), // can customize your rules
// minChunks: 3, // minimum common number
// priority: 5,
// reuseExistingChunk: true
// },
// jlmap3d: {
// name: 'chunk-jlmap3d',
// test: resolve('src/jlmap3d'), // can customize your rules
// minChunks: 3, // minimum common number
// priority: 5,
// reuseExistingChunk: true
// },
// ibp: {
// name: 'chunk-ibp',
// test: resolve('src/ibp'), // can customize your rules
// minChunks: 3, // minimum common number
// priority: 5,
// reuseExistingChunk: true
// }
}
});
config.optimization.runtimeChunk('single');