I have a base component that is extended by some other Components as follows:
// UserForm
<template>
<div class="user-form"></div>
</template>
// AdministratorForm
<template>
<UserForm v-model="administrator">
// additional fields
</UserForm>
</template>
Now I want to set up a dynamic route where the component is selected by a parameter:
{
path: '/users/:userTyp/:programId',
name: 'user-create',
component: () => import('@/modules/users/forms/'+ userTyp+ 'FormPage.vue'),
props: (route: any) => ({
programId: route.params.programId
})
}
Is there any way to have that dynamic routing and when, and how?
I use the following versions:
- "vue": "^2.6.11",
- "vue-router": "^3.2.0"