第一步:
找到本机ip地址
window+r输入cmd回车,输入ipconfig(若显示ipconfig不是内部或外部命令,百度解决方法)

找到ipv4,
打开vue项目,找到config目录下的index.js

将host:‘localhost’改为ipv4的地址就可以了。

如果不行清下浏览器缓存。
若此方法不行,参考下面一篇转载文章
https://segmentfault.com/a/1190000014301657?utm_source=index-hottest
第一步:
找到本机ip地址
window+r输入cmd回车,输入ipconfig(若显示ipconfig不是内部或外部命令,百度解决方法)
找到ipv4,
打开vue项目,找到config目录下的index.js
如果不行清下浏览器缓存。
若此方法不行,参考下面一篇转载文章
https://segmentfault.com/a/1190000014301657?utm_source=index-hottest
本文标题:vue 为使手机能够访问将localhost改为本地ip访问
本文链接:https://www.haomeiwen.com/subject/oeuicqtx.html
网友评论