通常,我们可以在vue项目中的config/index.js指定host,,如下(解host的注释)

veu npm  run dev指定host

 

 但是,在接手的目前项目中,解注释host后,npm run dev并有变为

http://192.168.43.230:8087,依然是http://localhost:8087

 

经过一番查找,发现要在build/dev-server.js文件中配置,如下。

veu npm  run dev指定host

 

相关文章: