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
548 stars 155 forks source link

Formatting phone numbers? #194

Open q00u opened 3 years ago

q00u commented 3 years ago

183 asks about this, and you point to this example in the doc

The example says to look at custom-string1 in the example.

But, in the example, where is custom-string1 defined? stringProp3 doesn't appear to display any differently than any other text box.

albanm commented 3 years ago

custom-string1 is a slot defined in the template of the example, it is referenced by stringProp3 that is rendered as a basic html text field (as defined in the matching slot) instead of the usual v-text-field.

This new example is more complete on the subject of writing custom components, which was the original question asked in the issue you reference.

Right now adding a custom component in a slot is the only way to do this. But I will tag this issue as a feature request and think about adding the functionality in an easier way. I need to think about it in more details, but maybe something like that would do the trick:

I can't say when I will be able to spend some time on this subject. If you need this soon you should look into the first solution of using slots and custom components.