I have a small Vue site I host on Cloudflare pages. From the main page, users can click into a modal which then has a button that navigates to another page using router.
<router-link :to="`/inahlers/${inhaler?.id}`" @click="closeModal" class="floating-info-button">Usage instructions</router-link>
And my routes are specified like this, if it makes a difference:
const routes: Array<RouteRecordRaw> = [
{
path: '/',
name: 'inhaler-list-main',
component: App
},
{
path: '/inhaler/:id',
name: 'inhaler-detail',
component: () => import('@/components/InhalerDetail.vue'),
props: true,