我正在使用具有历史模式的 Vue 路由器。在按钮上单击当前页面,我将其路由到下一页。在第二页上,当我重新加载时,我收到 404。有没有办法在 Vue 中处理这个问题并将其重定向到主页。
export default new Router({
mode: "history",
routes: [
{
path: "/",
name: "first",
component: First
},
{
path: "/abc",
name: "abc",
component: Second,
props: true
},
您可以使用哈希模式而不是历史模式来解决路由器上的问题
let router = new Router({
mode: "hash",
routes: [
{
//and the urls with path on here ...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)