1. index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<link rel="shortcut icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_740572_wb164twbrom.css">
<script src="https://cdn.bootcss.com/echarts/4.1.0-release/echarts.min.js"></script>
<script src="https://cdn.bootcss.com/babel-polyfill/7.6.0/polyfill.min.js"></script>
<script src="https://cdn.bootcss.com/axios/0.19.0-beta.1/axios.min.js"></script>
<script src="https://cdn.bootcss.com/qs/6.8.0/qs.min.js"></script>
<script src="https://cdn.bootcss.com/moment.js/2.22.2/moment.min.js"></script>
<script src="https://cdn.bootcss.com/moment.js/2.22.2/locale/zh-cn.js"></script>
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
<!-- <script src="https://cdn.bootcss.com/vuex/3.1.1/vuex.min.js"></script>-->
<script src="https://cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
<script src="https://cdn.bootcss.com/xlsx/0.15.1/xlsx.min.js"></script>
<script src="https://unpkg.com/[email protected]/lib/index.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/lib/theme-chalk/index.css">
<title>管理系统</title>
</head>
<body>
<noscript>
<strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
</body>
</html>
2. vue.config.js
productionSourceMap: false,
configureWebpack: {
externals: {
'vue': 'Vue',
'vue-router': 'VueRouter',
// 'vuex': 'Vuex',
"moment": "moment",
'echarts': 'echarts',
'axios': 'axios',
'qs': 'Qs',
'xlsx': 'xlsx',
'element-ui': 'ELEMENT'
}
},
3. 去掉import
4. CDN 资源
参考: