Uncaught ReferenceError: Vue is not defined :项目突然报错
问题描述
这几天项目突然就访问不了,报 Vue is not defined:
既然不是代码问题,初步分析是cdn加载慢或直接访问不了的原因
原因分析:
cdn 访问不了
解决方案:
暴力改法,直接将文件复制到本地引用。当然也可以换一个cdn或者自建cdn
```c <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title></title> </head> <body> <div id="app"></div> <!-- built files will be auto injected --> <!-- 引入样式 --> <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.2/lib/theme-chalk/index.css"> <!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.js"></script> <script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js"></script> <script src="https://unpkg.com/axios@0.18.1/dist/axios.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/d3@5.16.0/dist/d3.min.js"></script>--> <!-- 粗暴改法,直接将文件存在本地 --> <script src="static/vue@2.6.11.js"></script> <script src="static/moment@2.24.0.js"></script> <script src="static/axios@0.18.1.js"></script> <script src="static/d3@5.16.0.js"></script> <script src="https://pv.sohu.com/cityjson?ie=utf-8"></script> <!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g2/3.5.17/dist/g2.min.js"></script>--> <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=tg4QgzwdHGm7QPwSzwEKmKD5OpOvQd7u"></script> <script type="text/javascript" src="http://api.map.baidu.com/library/AreaRestriction/1.2/src/AreaRestriction_min.js"></script> </body> </html>
原文链接:https://blog.csdn.net/qq_37936348/article/details/124868250?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165934458816781647570962%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165934458816781647570962&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-3-124868250-null-null.nonecase&utm_term=%E8%87%AA%E5%BB%BAcdn
原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/6138