How to test and debug the vue project on mobile phones

Insert picture description here
1. In the host of index.js under the config folder , change it to the ip address of the computer
2. You can enter the cmd command to obtain the local IP address
Insert picture description here

3. Restart the project. Use npm run dev for vue-cli2.
4. You can use the QR code and scan the project on WeChat to debug the project.

Insert picture description here

5. If you want to debug in the mobile browser,
first, ensure that the mobile phone and computer use the same WiFi network under the same local area network, and
second, enter the ip address and port, and click save. After success, you can enter http://192.168.100.104:8080/ in the browser to access the vue project

Guess you like

Origin blog.csdn.net/weixin_45108907/article/details/104377647