I want to debug the Vue project on the PC side on my mobile phone (all projects with port numbers are applicable)

If it was helpful, please click a free like! Thank you~~~

1. First, make sure that the mobile phone and computer are in the same LAN

  1. When connected to the same wife.

  1. Turn on the hotspot on your phone, and then connect your computer to the hotspot on your phone.

2. Start the project

The cases here are all based on connecting to my own mobile phone hotspot.

  1. Let’s start with the project built by webpack.

(1) Start the project
(2) Copy the online address of project startup to the mobile browser

This refers to http://192.168.43.205.8080/

(3) Click the link to access or copy directly to the browser address
  1. Start project built with vite

(1) Start the project
(2) Copy the link to your phone and open it

***A test was done here. Only the last online address of this project works.

The reason has not yet been investigated clearly. I will come back and add more when I find out.

That is to say, for projects built by Vite, it is only possible to access http://192.68.43.205:3000/ on a mobile phone.

(3) The next step is to open the link and you can see the project interface!

These are some problems I encountered during development. I want to share them with you. I hope they can be helpful to everyone!

Guess you like

Origin blog.csdn.net/m0_55315930/article/details/128948301