Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Is it a good idea to generate dynamic routes with vue-router ?

Hello,

Is it possible to generate dynamic routes with vue-router ?

I mean ... the routes could for example be declared in the backend and according to the permissions of the connected user, it could be interesting to query for the only routes that are allowed.

import { createRouter, createWebHistory } from 'vue-router'
...
const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  ...
  // other dynamic items
]

What do you think about this idea ?

Thanks for your comments ;).

Vincent

0 likes
1 reply

Please or to participate in this conversation.