Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Latest commit

 

History

History
33 lines (27 loc) · 582 Bytes

README.md

File metadata and controls

33 lines (27 loc) · 582 Bytes

jsonschema-form

A Vue.js component to generate HTML form from JSON schema.

Usage

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" />`
}