[Vuejs]-Load routes from api and import views dynamically

0👍

the routes array that you build doesn’t contains your routes objects.
It’s an array of promises.

you should do something like

Promise.all(routes).then(resolvedRoutes => {
    this.$router.addRoutes(resolvedRoutes)
})

Leave a comment