Vue 打包运行报错
IE运行报愈发错误
vue 打包成App 在低于5.x 一下的安卓手机会运行报错。在IE上运行会报语法错误,是由于 引用了package.json 里面的swiper的组件导致,只需要将引用代码注释改换成 index.html 引入js 方式即可解决。
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.2.2/js/swiper.js"></script>
Webpack打包报 "Cannot read property 'call' of undefined"
原文:https://segmentfault.com/q/1010000014545856
解决方法:
- 打包完后,进入dist 文件夹修改index.html
修改前:
<script type=text/javascript src=/home_stay/static/js/manifest.6e0c0240c920e78b4f21.js></script>
<script type=text/javascript src=/home_stay/static/js/vendor.5f1b9e59bd38bb0d30c7.js></script>
<script type=text/javascript src=/home_stay/static/js/app.fa4b495fc2bb6f1e6120.js></script></script>
修改后:
<script>
document.write(`<script type=text/javascript src=/home_stay/static/js/manifest.6e0c0240c920e78b4f21.js?`+Math.random()+`><\/script>;<script type=text/javascript src=/home_stay/static/js/vendor.5f1b9e59bd38bb0d30c7.js?`+Math.random()+`><\/script>;<script type=text/javascript src=/home_stay/static/js/app.fa4b495fc2bb6f1e6120.js?`+Math.random()+`><\/script>;`)
</script>