Skip to content

[V4] How to have a numeric input field? (Quasar) #4172

Answered by logaretm
Sjoerd82 asked this question in Q&A
Discussion options

You must be logged in to vote

Moved this to Q&A discussions since it is not an issue with vee-validate.

The number input usually doesn't emit number values, but rather numeric strings. You could use a zod.preprocess to cast it.

z.object({
  test_id: z.preprocess((val) => Number(val), z.number()),
})

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Sjoerd82
Comment options

@logaretm
Comment options

@logaretm
Comment options

@Sjoerd82
Comment options

Answer selected by Sjoerd82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4168 on March 02, 2023 21:38.