I am looking to update the value of my function to a variable.
As an example, I have the following:
<input v-model="search.steering" @input="onChange('steering')"/>
This means that I want to insert the steering
every time I input text.
Here is the function:
onChange(typemember) {
this.search.typemember
}
What I am doing here is adding the value of typemember
to the this.search
variable.
So now the JavaScript variable will look like this: this.search.typemember
. The value of typemember
is pulled from @input="onChange('steering')"
.
In this case, the variable will be: this.search.steering
. Is this possible or is there another way to achieve this?
By the way, I am using Vue here.