Vue-router: beforeEnter next callback is not called

Created on 27 Jan 2019  ·  2Comments  ·  Source: vuejs/vue-router

Version

2.5.22

Reproduction link

https://jsfiddle.net/2ykhv8jq/

Steps to reproduce

Create a route with beforeEnter handler which calls next with a callback function.

In jsfiddle.net click the button and check the console.

What is expected?

"Am i called" and the vm should be present.

What is actually happening?

Line with "Am i called" is not present.


Code borrowed from https://github.com/vuejs/vue-router/issues/737#issuecomment-446565958

Most helpful comment

Is there a good reason for this? It's inconvenient!

All 2 comments

A callback is only supported in the in-component beforeRoutEnter guard.

Is there a good reason for this? It's inconvenient!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexstanbury picture alexstanbury  ·  3Comments

yyx990803 picture yyx990803  ·  3Comments

Lyfme picture Lyfme  ·  3Comments

shinygang picture shinygang  ·  3Comments

kerlor picture kerlor  ·  3Comments