json-schema-for-vuetify

0.25.1 • Public • Published

vuetify-jsonschema-form

NOTE: This is a forked from https://github.com/koumoul-dev/vuetify-jsonschema-form

Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.

Installation

npm i --save json-schema-for-vuetify

Usage

<template>
  <v-form v-model="formValid">
    <v-jsonschema-form v-if="schema" :schema="schema" :model="dataObject" :options="options" @error="showError" @change="showChange" @input="showInput" />
  </v-form>
</template>
 
<script>
import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
import Draggable from 'vuedraggable'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Swatches from 'vue-swatches'
import 'vue-swatches/dist/vue-swatches.min.css'
import VJsonschemaForm from 'json-schema-for-vuetify'
 
Vue.use(Vuetify)
Vue.use(VueAxios, axios)
 
Vue.component('swatches', Swatches)
Vue.component('draggable', Draggable)
 
export default {
  components: {VJsonschemaForm},
  data() {
    return {
      schema: {...},
      dataObject: {},
      formValid: false,
      options: {
        debug: false,
        disableAll: false,
        autoFoldObjects: true
      }
    }
  },
  methods: {
    showError(err) {
      window.alert(err)
    },
    change(e) {
      console.log('"change" event', e)
    },
    input(e) {
      console.log('"input" event', e)
    }
  }
}
</script> 

Readme

Keywords

none

Package Sidebar

Install

npm i json-schema-for-vuetify

Weekly Downloads

1

Version

0.25.1

License

MIT

Unpacked Size

1.24 MB

Total Files

17

Last publish

Collaborators

  • marcog21