About the routing refresh problem of vue router

there are two routes

{
    name: "article",
    path: "/article/:id",
    component: null
},
{
    name: "new-article",
    path: "/article/edit",
    component: ArticleEdit
},

now I am coding to the / article/edit page, and then after F5 refreshes, I will route to the / article/:id page. What should I do with this problem?

May.31,2022

there is something wrong with your two route names. / article/edit is in line with / article/:id . Change the name of the editor, do not use this route address that will cause potential problems. I think you should jump with the route name instead of path, but when refreshing, you can only match your route according to the path you are now in, so there will be problems.


  dynamic route matching usage 

  • change the path, do not let the matching of two routes overlap
  • Menu