I have Vue 3 app that uses Vue Router and need to use push with query instead of params. It looks as following:
function create() {
// router.push({ name: 'print-template-new', params: { readMode: false } })
router.push({
path: '/od/print-templates/new',
query: { readMode: false },
})
}
function clickTo(item) {
// router.push({
// name: 'print-template-card',
// params: { id: item.id, readMode: true },
// })
router.push({
path: `/od/print-templates/card/${item.id}`,
query: { readMode: true },
})
}
But, what I did with query doesn’t work as expected, because I get readMode = true in both cases.
How to make it work?