Level 50
watch(() => form.data(), (newData, oldData) => {
// ...
}, { deep: true })
Try this. https://vuejs.org/guide/essentials/watchers.html#deep-watchers
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I have dynamic forms in my create page
const form = useForm('post', route('dashboard.purchases.store'), {
seller_id: 0,
info_array: [{ title_id: 0, price_usd: '', price_gel: '', quantity: '' }]
})
let touchedFields = new Set();
watch(() => form.data(), (newData, oldData) => {
let changedFields = Object.keys(newData).filter(field => newData[field] !== oldData);
touchedFields = new Set([...changedFields, ...touchedFields]);
console.log(touchedFields);
})
But it check only (seller_id) field. How can I watch info_array?
Please or to participate in this conversation.