Article Directory
1. Obtain the ip address
window+r, enter cmd and press Enter, then enter ipconfig
The ipv4 address is yours
2. Make sure your mobile phone and computer use the same wifi
3. Modify the configuration file
(1) Modify the vue.config.js file host localhost
to host 0.0.0.0
(2) Your vue.config.js file can be configured in the index.js file of the config folder due to more configurations. (
3) Modify the package.json file to add –host 0.0.0.0, and then restart the project.
"scripts": { "dev": "webpack-dev-server --host 0.0.0.0 --inline --progress --config build/webpack.dev.conf.js", }
Note: After re-running the project, use the ip address plus the port number, such
as: http://192.168.101.101:8080