kazupon / vue-validator

:white_check_mark: Validator component for Vue.js
MIT License
2.19k stars 431 forks source link

how to validate this feilds #280

Closed jackPanyj closed 8 years ago

jackPanyj commented 8 years ago

when some elements is rendered after user input a value , the validation doesn't work.

this is a reproduction

http://codepen.io/jackpan/pen/yJpzPG

in this demo, the input that rendered after user input does'n work

jackPanyj commented 8 years ago

@Nandiin

nandin-borjigin commented 8 years ago

similar #249 The use-case is mostly identical, so you can refer to my comment on this issue.

The point is you are rendering a list of inputs using v-for directive but assigning a static validation field name ( in your demo, 'amount'), so the last item of the list overrides the former ones. Dynamic field names are needed in this case.

There is my modification on your codepen

nandin-borjigin commented 8 years ago

This issue can be closed I think @kazupon

jackPanyj commented 8 years ago

@Nandiin thank you i closed it