A Vue.js component to generate HTML form from JSON schema.
import JSONSchemaForm from 'jsonschema-form'
const schema = {
title: 'Login Form',
type: 'object',
required: ['username', 'password'],
properties: {
username: { type: 'string' },
password: { type: 'string', minLength: 8 }
}
}
export default {
data () {
return {
schema,
data: {}
}
},
components: {
'schema-form': JSONSchemaForm
},
template: `<schema-form :schema="schema" v-model="data" />`
}