koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
546 stars 155 forks source link

Question: use v-model modifiers in textfields #262

Open weissphi opened 3 years ago

weissphi commented 3 years ago

hi,

Is there a possibility to set v-model modifiers for components. I want to trim the input into a generated text field. For this I would like to use a v-model.trim, but I don't see a way to pass this in the options.

thank you

albanm commented 3 years ago

Not possible for now, you will need to apply the modification yourself. But that would be a nice addition to the current functionalities, I will think about it.

ftonato commented 2 years ago

Hi @albanm, is there any plan to release this?

albanm commented 2 years ago

I don't think v-model modifiers can be used in render functions (not templates). I think it would have to be implemented entirely by vjsf, something like a set of standard and custom modifiers referenced by schema properties.

No immediate plan. But I don't close the issue either, it is interesting for the roadmap.

ftonato commented 2 years ago

I don't know if it fits the tool's proposal, but maybe we could pass a property called shouldTrim or something and if it was present, it would remove the .trim() spaces. when the input received the value.

albanm commented 2 years ago

If think I would aim for something a little more generic similar to vuejs modifiers. Something like x-modifiers=["trim", "uppercase"].