1
I’m already detecting when the pressure is enter in the input, how can I make to catch the current value that input too? Can’t be with v-model
, because I need to leave a value default, as shown in the example below:
HTML
<div id="listas-page">
@foreach($listas as $lista)
<input type="text" value="{{$lista->descricao}}" v-on:keyup.13="editName">
@endforeach
</div>
JS
var listasPage = new Vue({
el: '#listas-page',
methods: {
editName(event) {
console.log(event);
}
}
});
Why can’t you use v-model? It’s perfect for setting a default value: https://jsfiddle.net/50wL7mdz/92446/
– Miguel
It is that I am bringing several inputs with their respective values from the bank. And I am doing this with a foreach in php.
– Diego Vieira