What is the proper way to do custom validation on a number component?

I can't find any documentation on how to use the custom rule.

I have a number component that I want to force the user to enter a value for. Must be greater than 0.

If I add a required rule, 0 is a value so the form submits.

If I add a minimum validation rule of 1, it simply fills it in with 1 when I submit the form.

If I add a custom rule: {{numberInput1.value > 1}} then I get a validation message that is confusing to the user:


I tried a custom rule like: {{numberInput1.value > 0 ? true : "Please enter a value"}}, but it is always invalid:

I think for custom validation then any string is treated as an error and nullish is treated as success - so returning true will make the field invalid but without an error message to show (hence the false)

try something like {{numberInput1.value < 1 ? 'invalid entry' : ''}}


Ok, an empty string or null seems to work. So yeah, nullish not falsy is the test because false does not work.