Skip to content

pushing query params #1631

@VdustR

Description

@VdustR

What problem does this feature solve?

As we can push router with query like router.push({query: {a: 1, b: 2}})

but it's not convenient while I just want to add a condition.

I do this as the followed code to get query string ?a=1&b=2&c=3:

import _ from 'lodash'
let query = _.cloneDeep(router.currentRoute.query)
query.c = 3
router.push(query)

What does the proposed API look like?

router.pushQueryParams({c: 3})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions