In my VueJS project, I am working with two separate components:
One is a modal and the other is a form.
Within the modal component, the user inputs a PIN which is then confirmed. This value is then set to an input tag in the form component to save it.
To set the value in the modal component, I use this simple line of code:
document.getElementById('pin').value = this.pin_input;
The input tag within the form component looks like this:
<input type="hidden" @change="submit()" id="pin">
Although the value of this input tag is correctly being set in the console, the @change="submit()"
event is not being triggered when the value changes.
The submit method within the form component that is not being called is as follows:
methods : {
submit : function(){
console.log("SUBMIT HERE");
}
}
What could be the reason behind my input tag's @change
event not getting called?