Closed BestDingSheng closed 7 years ago
api代理只能在开发环境下使用。 项目打包后,要想使用豆瓣的api,你得自己搭个后端的API转发,才能解决跨域问题。
不会后端 ,大神有什么解决方案么。 axiso 有jsonp之类的跨域请求么
https://github.com/mzabriskie/axios/issues/342 官方说了,axios并不支持jsonp。 我改天我再写个node,转发api的demo。
哈哈哈 谢谢大神 能否加个QQ或者微信 不懂的可以请教下您
qq 673318522
首先感谢楼主的分享,然后请教两个问题,还没来得及仔细研究, 1.为啥页面中审查DOM,发现id="app"的div不见了?是不是打包之后插入的地方有问题,导致直接覆盖了,然后id为app的div直接就消失了 2.页面中审查元素发现style标签很多而且有几个都是空内容,留下了很多空白,如下图: @superman66
new HtmlWebpackPlugin
而产生的。具体的原因有待研究。vue-loader
在编译.vue
文件的时候,只要遇到<style>
标签,便会将其编译成<style></style>
内嵌到HTML中的header。出现空白是因为有几个vue单文件的<style></style>
内是为空的,所以就会产生空白。我把vue单文件中空白的style都去掉后,这个问题便解决了。
项目打包后 豆瓣电影的api 地址就不对了 ![Uploading image.png…]() 怎么解决