M
M
myskypesla2018-04-22 02:48:39
Vue.js
myskypesla, 2018-04-22 02:48:39

How to do validation with VeeValidate or which validator can choose better?

There is 1 form and 2 inputs. An example is here . Depending on the value of the variable, it should show one or the other input with validation.
But due to the fact that input #2 does not exist during the initial render, the VeeValidate library is not applied to it.
Tell me how can I solve? And is there a better way to validate than VeeValidate?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-04-22
@myskypesla

due to the fact that input #2 does not exist during the initial render, the VeeValidate library is not applied to it

Not really, "input #2" - it doesn't exist at all, ever. When changing the value of show, an already created element is used - because virtual dom, yeah. Because of this, veevalidate and mows.
Set the key to the inputs - then they will be recreated when the show changes, and veevalidate will work as it should.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question