[Vuejs]-Validate dynamic input field in vue.js

0👍

You will always check for the first row, because of if (this.rows[0]...)
rows[0] will always take the first object in your array

If you always want to validate all the rows, you could check if there are any rows without a supplier id: if (this.rows.filter((row) => row.supplier_id1 === "").length)

0👍

I not sure which toast component did you used, but i can do similar mock for your validation message + databinding of your {{row.supplier_id1}}

v-model value of input[type="date] will only valid when you inputted date correctly so this.rows[0].supplier_id1.length == 0 to validate is fine. The reactivity is working fine.

My Working Fiddle: https://jsfiddle.net/bu9twps2/

UPDATE: Your original condition to validate works fine as well, problem likely lies at your toast

Leave a comment