I am facing a challenge with an input field setup like this:
<input type="text" @input=readInput('usernameInput')>
Accompanied by data and methods for handling it:
data() {
return {
usernameInput = false;
};
},
readInput(form) {
console.log(form); //usernameInput
}
Whenever a user types in the input
field, the readInput
method triggers with the term 'usernameInput' as an argument.
However, I am attempting to achieve something different:
readInput(form) {
this.form = true;
}
I aim to change usernameInput
to true
once any character is entered into the input field. Essentially, I want this.form
to be equivalent to this.usernameInput
. Is there a way to accomplish this task?
Note: while I can directly set this.usernameInput = true
, I desire a more generalized approach.