Why is vue $on not triggered?

elementuidispatch

dispatch


Why is it triggered only in the hook function of created, but mounted does not trigger $on, but 668 has output? it is useless for me to comment on the $on of created, why is the $on of mounted not triggered? I saw that elementui also wrote $on in mounted.


$on is registered, not when
this.dispatch abc is triggered. If it is not registered, it will not be triggered

.
  • On the problem of vue Navigation Guard

    from the first page to the second routing page, the value of from is printed out through the component guard beforeRouteEnter on the second routing page, as shown in the following figure from is empty and can not get the information of the first page...

Menu