ylliX - Online Advertising Network
Vertex AI - Antrophic and Mistral models: Why does it require Imegen access?

How to use query instead of params in Vue Router’s push?


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?



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *