1. Enter ipconfig in the cmd window to view the local IP address
ipconfig
2. Go to index.js in the config directory of the project, and replace localhost with the ip address
3. In package.json, add --host 0.0.0.0 to the dev field
Run the project at this time, you can access the project through the ip address
Restart the project npm run dev
and copy the project address Use the forage QR code generator to generate a QR code Scan the code with your mobile phone to view it
Address: Forage Text QR Code Generator
4. The problem of the white screen of the mobile phone
Some browsers do not support promise, downloading babel-polyfill can solve it
cnpm i babel-polyfill
Introduce it in main.js