Skip to content

Can not get route name with useRoute hook #1109

@fayeah

Description

@fayeah

Version

4.0.11

Reproduction link

codesandbox.io

Steps to reproduce

get route name inside setup method with useRoute hook, then refresh the page, name is undefined:

 const route = useRoute();
 console.log("route", route.name);

What is expected?

can get the name

What is actually happening?

name is undefined


I checked the route info, and have set the name for each route. tried onBeforeRouteUpdate hook inside setup method, it's event not evoked. not sure why, please help to figure it out.

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