vue-form-json-schema
  • Introduction
  • Installation
  • Getting started
  • API
    • vue-form-json-schema
      • components
      • options
        • ajv
      • schema
      • uiSchema
        • field
          • component
          • children
          • displayOptions
          • dynamicOptions
          • errorHandler
          • errorOptions
          • eventProp
          • fieldOptions
            • attrs
            • class
            • domProps
            • key
            • nativeOn
            • on
            • props
            • slot
            • style
          • internalModel
          • valueModel
          • valueProp
Powered by GitBook
On this page
  1. API
  2. vue-form-json-schema
  3. uiSchema
  4. field

component

PreviousfieldNextchildren

Last updated 5 years ago

The component property can refer to any or .

// Option 1 - HTML element tag
data() {
  return {
    uiSchema: [{
      component: 'div'
    }]
  }
}
// Option 2 - Globally registered component
data() {
  return {
    uiSchema: [{
      component: 'my-custom-component'
    }]
  }
}
// Option 3 - component object
import MyCustomComponent from './my-custom-component'

...

data() {
  return {
    uiSchema: [{
      component: MyCustomComponent
    }]
  }
}
// Option 4 - Component from components prop
import MyCustomComponent from './my-custom-component'

...

data() {
  return {
    components: {
      MyCustomComponent
    },
    uiSchema: [{
      component: 'MyCustomComponent'
    }],
    model: { ... },
    schema: { ... }
  }
}

....

<template>
  <vue-form-json-schema
    v-model="model"
    :components="components"
    :ui-schema="uiSchema"
    :schema="schema"
  />
</template>
Vue component
HTML element tag name