一、引入.env定义全局变量
1、.env.development文件
VUE_APP_URL= 'http://xxx.xxx.xx.xx:端口号'
2、public/index.html 使用
<script src="<%=process.env.VUE_APP_URL%>"></script>
二、引入本地文件
1、public文件夹下创建一个index.js文件
目录如下:
2、public/index.html使用
<script src="<%= BASE_URL %>index.js"></script>