A
A
Artemio952021-09-28 16:00:40
Vue.js
Artemio95, 2021-09-28 16:00:40

How in Vue to wait for something to load and only after successful loading allow to hang a click handler?

I need to wait for the data to come from the server and only then allow the user to click. How to do it? The option to display the button first without a handler, and then with is not suitable

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-09-28
@Artemio95

Here it is not necessary this nonsense with juggling handlers.
Let the button be inactive until there is no data: At the same time, the user, instead of being perplexed about the absence of any reaction to his actions, will clearly see that clicking on the button is not something that is not necessary - it's pointless.
<button :disabled="!данные" @click="onClick">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question