The guard beforeRouteEnter in the vue-router component triggers, but the beforeRouteLeave does not trigger.

I am in the .vue file:

export default {
  name: "SomeName",
  beforeRouteLeave(to, from, next) {
    console.log(" beforeRouteLeave !", this)
  },
  beforeRouteEnter(to, from, next) {
    console.log(" beforeRouteEnter !")
  }
}

but the guard beforeRouteEnter triggers while beforeRouteLeave does not trigger when entering the route. I wonder if my posture is not correct.

Environment: vue: 2.5.16 , Chrome65

Mar.02,2021

after my experiment, I found that it was my fault.

in the route guard, you need to call next () to enter the route. Otherwise, if there is no next () in beforeRouteEnter , the content of the guard will be executed, but the route cannot be entered. The correct way to write it is

.
  

because you do not leave (next ()); after entering
, of course there is no chance to execute beforeRouteLeave again

Menu