Quasar: [Feature Request] Input built-in validation

Created on 13 Nov 2017  路  3Comments  路  Source: quasarframework/quasar

Halo,
How about adding built-in basic validation to the q-input or q-field
something like

q-input(:errors="[Boolean(name) || 'name is required', name.length >= 2 || 'minimal 2 chars']", v-model="name")
q-input(:warnings="[name.length > 1000 || 'too many chars']", v-model="name")

Most helpful comment

@nueko It's not a bad idea. However reinventing the wheel here adds no value. If Quasar has something simple, devs will jump asking for more and more features (like it happened with Dialog) -- and we'll end up duplicating packages like vuelidate. Vuelidate is simply easy and great and the devs are going into the right direction with it, so I strongly recommend this package.

All 3 comments

This is pretty easily solvable via comoputed properties or a 3rd party library allready.

@vuchl yes that is.
we can use vee-validate or vuelidate. But it will be nice if we have the simple one built-in

@nueko It's not a bad idea. However reinventing the wheel here adds no value. If Quasar has something simple, devs will jump asking for more and more features (like it happened with Dialog) -- and we'll end up duplicating packages like vuelidate. Vuelidate is simply easy and great and the devs are going into the right direction with it, so I strongly recommend this package.

Was this page helpful?
0 / 5 - 0 ratings