I have set up a route with a value
parameter:
routes.push({
name: 'test',
path: '/test/:value',
component: resolve(__dirname, 'src/pages/test.vue'),
});
Now, I want to modify the route so that it also includes both value
and test
as parameters:
routes.push({
name: 'test',
path: '/test/:value',
component: resolve(__dirname, 'src/pages/test.vue'),
beforeEnter(to, from, next) {
to.params.test = 'test';
next({ params: to.params });
},
});
This way, I will be able to access these parameters in a vue page:
async fetch({ store, route }) {
console.log(route.params.value);
console.log(route.params.test);
},
However, the code for the beforeEnter
is not functioning correctly as the new test
parameter is not being sent. Any suggestions on how to fix this?