When beforeRouteUpdate, why can't you add the selected style?

clipboard.png

clipboard.png

clipboard.png

clipboard.png
what"s wrong with not adding this class? Ask for advice

Mar.06,2021

what you configure is a routing guard.
this this represents a router object instead of a vue object.
if you should handle these things during the life cycle of the vue component


beforeRouteUpdate is a hook that is triggered when calling a reused component, which cannot be triggered if you are routing this component for the first time. Only reuse can trigger. The subject had better deal with the lifecycle of vue components.

  https://router.vuejs.org/zh-c.

Menu