Vue-cli starts the local service. The reason why the local service cannot be accessed through ip address in the LAN is vue-cliip.
1. Problem description:
A new vue-cli project has been developed. If you want to view the effect on your mobile phone, you will find that the access fails. The ip address and port number are correct, but the mobile phone number cannot be accessed. You cannot enter the same ip port number in the browser of your computer, it can only be accessed through localhost: 8080. Other mobile phones and computers on the same LAN cannot access and debug through IP addresses,
2. cause: the vue-cli project is generated with one click through the command line. The local debugging mode is generated by default in the configuration file, and the default access address is localhost: 8080.
3. method of correction
Find the index. js file in the config folder and Modify host: "localhost" TO host: "0.0.0.0". At this time, the mobile phone and other computers in the same LAN can view the page through ip + port number.