在项目中遇到了一个错误,跳转路由一刷新页面就白屏报错 Uncaught SyntaxError: Unexpected token < 后来查询了百度知道是 vue-router 中mede设置成history。

官网说明:不过这种模式要玩好,还需要后台配置支持。因为我们的应用是个单页客户端应用,如果后台没有正确的配置,当用户在浏览器直接访问 http://oursite.com/user/id 就会返回 404,这就不好看了。

vue Uncaught SyntaxError: Unexpected token 错误

解决方法是:不设置 mode: “history” 具体想知道原因的自行百度。一下是官网说明加地址。

官方文档说明是vue Uncaught SyntaxError: Unexpected token 错误

相关文章:

  • 2021-10-18
  • 2021-09-02
  • 2021-04-19
  • 2021-06-21
  • 2021-07-22
猜你喜欢
  • 2021-09-30
  • 2022-12-23
  • 2021-07-28
  • 2021-06-27
  • 2022-12-23
  • 2021-10-31
  • 2021-03-30
相关资源
相似解决方案