Answers for "vue enter event"

6

enter key vue

<!-- only call `vm.submit()` when the `key` is `Enter` -->
<input v-on:keyup.enter="submit()">
<input @keyup.enter="submit()">
vue
Posted by: Guest on January-03-2021
4

@keyup.enter vue

<input v-on:keyup.enter="submit">
<!-- Also works like this: -->
<input @keyup.enter="submit">
Posted by: Guest on July-16-2020
0

Vuejs v-model when enter pressed

<input type="text" v-on:keyup.enter="submit" />
<p> {{ outputValueOnEnter }} </p>

//In data() :
outputValueOnEnter = ''

// In methods: 
submit(e) {
 this.outputValueOnEnter = e.target.value
 e.target.value = ''
}
Posted by: Guest on December-16-2020

Browse Popular Code Answers by Language