Answer the question
In order to leave comments, you need to log in
How to run a method on key press?
There is a form field input in a child component (a form within a form)
<div class="form-group">
<label for="website">Вебсайт</label>
<input v-model="object.website" class="form-control" type="text" name="website" id="website" placeholder="Вебсайт" @onkeyup="sendContacts()">
</div>
sendContacts() {
this.$emit('send_contacts', this.object);
},
onkeydown реагирует на нажатие клавиши;
onkeypress реагирует на нажатие клавиши;
onkeyup реагирует на отпускание клавиши;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question