Vue is packaged and put on the server to load for the first time.

when the vue project is packaged and sent to the server to browse on the mobile phone, it is found that the router-link does not jump and the click event does not take effect. Later, the preview on the computer found that it reported a 404 error
clipboard.png
and then refreshed it. Have you ever met. What is the reason

Mar.02,2021

you use the history mode, right? This needs to be handled by the backend


if you use history mode, take a look at these

on vue-router 's official website.

clipboard.png
https://router.vuejs.org/zh-c.
asks you to take a look at this backstage and do some processing. Or do not use history mode

Asynchronous loading for

?


when the front-end code is put on the server, you need to use nginx or iis to do a reverse proxy, because all your front-end business is completed in the index.html file


how to solve it?

Menu