Why did you re-enter beforeEach after vue-router addRoutes?

  1. in the router object hook beforeEach, I use the addRoutes method to dynamically add a route to the router and find infinite calls to beforeEach,. I want to know why? As shown in the figure

clipboard.png
reference link: https://jsfiddle.net/L7hscd8h.

Mar.04,2021

do not use / * , * number for a specific name


  1. you can put 404 routes last according to the official lazy load;

    const router = new VueRouter({
        mode: 'history',
        routes: [
            { path: '*', component: NotFoundComponent }
        ]
    })
  2. reference article: addRoutes; it is also implemented to load 404 at last
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-7b0025-25e90.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-7b0025-25e90.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?