V
V
Vasya902021-07-22 14:10:17
Vue.js
Vasya90, 2021-07-22 14:10:17

How to make a button inactive for a few seconds after it is clicked?

There is a text of the area, it has an icon, by clicking on which a submit takes place. You need to somehow make the button inactive for a few seconds after pressing. I can’t find how to make this icon inactive, but you can use the attribute disabledto make the entire field inactive, including the icon. I can bind this attribute, but then how can I make sure that there is a labor there for a while, and then a fall and the field becomes available?

<v-textarea
              v-model="message"
              @click:append="sendMessage"
              :label="Введите сообщение"
              append-icon="mdi-send"
              :disabled="///////////////////////"
          ></v-textarea>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2021-07-22
@Vasya90

add a field to the component somewhere in the submit handling
disabledSubmit: false
:disabled="disabledSubmit">

this.submitDisabled = true; // Перед запросом
Vue.axios.get('/info')
    .then(info => {
      this.submitDisabled = false; // Запрос выполнен
      // ...
    });

K
Kirill Romanov, 2021-07-22
@Djaler

this.textAreaDisabled = true;
setTimeout(() => {
    this.textAreaDisabled = false;
}, 5000)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question