I
I
Igor2021-01-17 16:06:19
Vue.js
Igor, 2021-01-17 16:06:19

How to spin the button spinner in Vue depending on the route?

How to spin the button spinner when transitioning, depending on the route?
I am using Vuetify.

The button has to and loading parameters.

1. It is necessary to determine the fact of the transition
2. Pointwise change the value of the loading directive to true

Obviously, having a global variable that determines that we are on the way to the end of the route is a wrong decision, since all links will spin their spinner.

I suspect that you can do this somehow through your directive.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valery Voronkov, 2021-01-17
@xcodervv

Routing has parameters from, to - which determine the transition from and to. Perhaps you need to dig in this direction.
Component Guards

A
Alexander Talalaev, 2021-01-18
@neuotq

come up with a way to add a unique identifier to link components, do this through the state. So you can build more complex logic, if desired, with chains and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question