Skip to content

Named route records with optional root-level param will result in an empty URL when you don't use the param #1357

@hworld

Description

@hworld

Version

4.0.14

Reproduction link

jsfiddle.net/5m1nz3gf/

Steps to reproduce

Inspect the "Hot" url to see that the tag's href attribute is an empty string.
The other link's href attributes are correct.
If you click on the Hot link, it routes correctly since the router is the thing doing the direction, but if you look at the status bar when hovering the link, it'll show the current page's address since the href is empty. This breaks middle clicking to open in new tab since it will just open the current page instead of what vue router would actually direct to.

What is expected?

It should render the href attribute as '/'

What is actually happening?

Empty href

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions