-
-
Notifications
You must be signed in to change notification settings - Fork 99
Closed
Labels
Description
Discussed in #414
Originally posted by AnnaMuza March 13, 2025
I've been struggling with a specific issue in my Vueform implementation that I hope someone can help clarify.
I'm trying to work with a structure where I have a ListElement containing objects, and within those objects, I need certain fields to be treated as numbers rather than strings. Specifically, I have an id
field that I need to be a numeric type.
Here's a simplified version of my current implementation:
<Vueform v-model="formModel"
:schema="{
items: {
type: 'list',
element: {
type: 'object',
schema: {
id: {
type: 'text',
inputType: 'number',
rules: 'numeric',
default: -1,
autocomplete: 'off',
label: 'ID',
},
// Other fields...
}
}
}
}"/>
The problem is that even with inputType: 'number'
and rules: 'numeric'
, forceNumbers=true, the id
value is still being treated as a string in the model. I'd appreciate any guidance or examples of how others have solved this issue.
Thank you in advance!