vue本地项目手机访问

vue本地项目手机访问


关于本地上同一局域网访问电脑上vue项目
找到package.json文件,添加–host 0.0.0.0即可

“scripts”: {
“dev”: “webpack-dev-server –host 0.0.0.0 --inline --progress --config build/webpack.dev.conf.js”,
“start”: “npm run dev”,
“build”: “node build/build.js”
},

或者在“~/config/index.js”文件中加host: ‘0.0.0.0’,

module.exports = {
dev: {

host: ‘0.0.0.0’, // can be overwritten by process.env.HOST localhost
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free …
},

}

你可能感兴趣的:(vue)