3 ms·
I've seen several decent implementations based on https://json-schema.org/implementations.html#web-ui-generation https://json-schema.org/implementations.html#we
by sheeeep86 7y ago
I've seen several decent implementations based on https://json-schema.org/implementations.html#web-ui-generation https://json-schema.org/implementations.html#web-ui-generati...
Json schema also has many tools for validation, which is nice if you're passing the form data around.
- benkarst 7y agoJSONForm (https://github.com/jsonform/jsonform https://github.com/jsonform/jsonform) looks very promising. Thanks!
- emorning3 7y agoAlso check out https://github.com/rjsf-team/react-jsonschema-form https://github.com/rjsf-team/react-jsonschema-form
- gremlinsinc 7y agoThere's this for Vue: https://github.com/vue-generators/vue-form-generator https://github.com/vue-generators/vue-form-generator Looks promising. However my recommendation is create single components for common elements you use a lot... Like... have a structure like resources/js/form/elements where you might have: Input.vue Email.vue Password.vue and all types... set some sensible defaults put use props so they're all overrideable. Then create forms by model: resources/js/users/forms: FirstName.vue would look something like: <template><form-input extraJson:"{readonly: true}" /></template> Then your users/form.vue would be like" <template> <first-name /> <last-name> <email> </template> Then say you have two types of users like users and customers... and two different forms -- you can reuse the email/name input modules in other forms so you don't duplicate content. I use inertiajs+laravel+vue though, and handle validations via laravel and don't generally need to use the whole json schema thing, as it just makes for more code. I like handling the validations in the backend and let the frontend just focus on ui/ux.