Skip to content

can't get the right route path in 'ready' method #75

@dazhenhan

Description

@dazhenhan

Simplify my scene:

I wrote two components, a login.vue and a main.vue, after click a button in login.vue ,it executes 'route.go('/main')', the router-view renderered the main.vue content, but, in the main.vue's ready method, 'router.app.$route.path' returns '/login', not '/main', I don't know other ways to get the right route path in 'ready' method after a router-view is changed

I use vue-router 0.4.0, and vue.js 0.12.10

is there a proper way to get the right path after change a route?

before I got the problem above, I use 'route.afterEach' method to capture the route change event, it's seems that this method is removed in vue-router 0.4.0

I find a way, use 'router._currentRoute.path' can read the right path in 'ready' method, but, I think it's not a good way

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