vue项目只能用localhost访问,换成本地Ip没法访问【解决】

将配置文件config中的index.js中的host值由‘localhost’为‘0.0.0.0’,这样既可用localhost访问也可用本地IP访问。配置