启动vue项目时,一般显示都是localhost:8080,想要快速测试的时候,就需要一次一次的发布,那如何启动一个可分享的项目呢?
- 找到项目中从
/config文件夹 - 点击
index.js文件
const os = require('os');
let localhost = ''
try {
const network = os.networkInterfaces()
localhost = network[Object.keys(network)[0]][1].address
} catch (e) {
localhost = 'localhost';
}
module.exports中
dev中的host:填写localhost
- 再启动项目试试!