Skip to content

Router push programmatically with default params as null #1429

@ruchernchong

Description

@ruchernchong

Version

2.5.3

https://codepen.io/ruchern/pen/jmvWra

Steps to reproduce

Using the following code and assigning params to null does not route correctly.

methods: {
    navigate(route, params = null) {
        this.$router.push(route, {
            params: params
        }
    }
}

What is expected?

Expects the route to navigate properly even when the param is null.

What is actually happening?

Router is throwing the errror message:
Uncaught TypeError: Cannot use 'in' operator to search for 'id' in null

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