search

Home  >  Q&A  >  body text

vue2 router problem


1. I used tomcat to run the packaged project. As soon as I refreshed the browser page, it jumped to 404, but set
mode: 'hash', browse The server will not do this, but the URL is too ugly. Why?
2. My routing project is configured like this:

我想大声告诉你我想大声告诉你2794 days ago810

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-06-26 10:58:43

    When you enter the address in your browser, it is parsed by Tomcat. It finds that there is no matching method or file under the current route of your server, so it naturally returns 404. You need to configure the server so that all routes starting with /PcsBrowser/ point to your Vue entry file.

    reply
    0
  • 扔个三星炸死你

    扔个三星炸死你2017-06-26 10:58:43

    To play this mode well, you also need background configuration support
    Reference: HTML5 History mode

    reply
    0
  • Cancelreply