Answer the question
In order to leave comments, you need to log in
What's wrong with select'a binding on vue?
It seems that I do everything according to the manual, but the data from the select is not pulled into data:
<select v-model='currentOrder' @change='onChange'>
<option v-for="(order, key) in orders" v-bind:key="key" v-bind:value="order.ID">{{order.NAME}}</option>
</select>
document.addEventListener('DOMContentLoaded', function(){
var returnApp = new Vue({
el: '#return_app',
data: function(){
return{
orders: window.OW.returnData.ORDERS,
allErrorArray: [],
currentOrder: null,
}
},
methods:{
onChange:function(event){
console.log(event.target.value);
}
}
});
});
Answer the question
In order to leave comments, you need to log in
I think you are looking at it wrong. The select value is normally set to data.currentOrder, you can see for yourself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question