Skip to content

router.go and its implementations doesn't mark n as optional #3065

@FyiurAmron

Description

@FyiurAmron

Version

3.1.3

Reproduction link

read https://developer.mozilla.org/en-US/docs/Web/API/History/go#Parameters

Steps to reproduce

verify the source code vs the spec

What is expected?

router.go and its history implementations should mark the delta param as optional (also, if possible, the param should be named more descriptively, e.g. "delta" as in spec)

What is actually happening?

router.go and its history implementations are marking "n" as required, although it actually isn't, and should default to 0 to maintain POLA

Source code links

go (n: number) {

also https://github.com/vuejs/vue-router/blame/479510b2bf6342cf083299da28334c6925ae465a/src/history/html5.js#L40 etc. (all https://github.com/vuejs/vue-router/tree/479510b2bf6342cf083299da28334c6925ae465a/src/history implementations are affected)

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