Closed stackoverfloweth closed 1 month ago
Given these routes from the stackblitz repo
const routes = createRoutes([ { name: 'home', path: '/', component: HomeView, }, { name: 'settings', path: '/settings', query: 'search=[?search]', component: () => import('../views/SettingsView.vue'), children: createRoutes([ { name: 'profile', path: '/profile', component: () => import('../views/SettingsProfileView.vue'), }, { name: 'keys', path: '/keys', query: query('sort=[?sort]', { sort: sortParam }), component: () => import('../views/SettingsKeysView.vue'), }, ]) }, ]);
Notice how settings has a query param for search and is a parent to profile and keys. If I set a value on this param and then navigate to a child the param value is lost. This is true for both using a router-link to navigate as well as router.push.
settings
search
profile
keys
router-link
router.push
https://github.com/kitbagjs/router/assets/6098901/603aa824-b6a4-4949-862f-cba485f2de7d
Given these routes from the stackblitz repo
Notice how
settings
has a query param forsearch
and is a parent toprofile
andkeys
. If I set a value on this param and then navigate to a child the param value is lost. This is true for both using arouter-link
to navigate as well asrouter.push
.https://github.com/kitbagjs/router/assets/6098901/603aa824-b6a4-4949-862f-cba485f2de7d