Get route in external js file

hi,
i have a js file:

index.js
import {createRouter, createWebHistory} from ‘vue-router’
import routes from ‘./routes.js’
import store from ‘…/store’

const router = createRouter({
linkActiveClass: “active”,
history: createWebHistory(),
routes
});

export default router;

and router.js:

export default [
{
path: ‘/404’,
component: err404,
name: ‘404’,
},
{
path: ‘/test’,
component: Test,
name: ‘test’,
meta: {
title: ‘Test’,
id: 0
}
},
]

in app.js i have:
import router from ‘./router’;
export const app = createApp(App);
app.use(router);

it’s possible to pass $route.params.id in router.js ??

br
Max

hello @maxdiable ,
$route.params.id this will be passed in template section.
If you want to pass the id in route you can pass like this:
{ path: ‘test/:id’, component: Test }

For further information you can go through with this: https://router.vuejs.org/guide/essentials/dynamic-matching.html