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
    MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
    MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5226e-59715.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
    MySQL Errno : 1021
    Message : Disk full (/tmp/#sql-temptable-64f5-1e5226e-59715.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
    Need Help?