У меня есть приложение Vue2 с watch
, которое не срабатывает, когда данные поступают от вызова ajax.
HTML
<tr v-for="arrayresult , key in arrayresults">
<td><input class='quantity' name='items_quantity_quantity[]' type='number' value='1' @keyup='check_item_offer(arrayresult.id,arrayresult.unit_id,arrayresult.qty,key,arrayresult.item_tax_value)' @change='check_item_offer(arrayresult.id,arrayresult.unit_id,arrayresult.qty,key,arrayresult.item_tax_value)' @keyup.enter='go_to_message' v-model='arrayresult.qty'/></td>
</tr>
Код Vue
watch:{
// arrayresult come from the ajax call.
'arrayresult.qty': {
handler: function (after, before)
{
alert("asdf");
},
deep: true
}
}
Замена arrayresult.qty
с помощью другой опоры - все работает