0.36.4 • Published 4 years ago

@koumoul/vuetify-jsonschema-form v0.36.4

Weekly downloads
813
License
MIT
Repository
github
Last release
4 years ago

vuetify-jsonschema-form

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

npm.io

All basic types, nested objects, nested arrays, various display options, simple validation rules, custom content injected using slots, etc. For a view of all the functionalities check the demo.

Compatible with vuetify 1 and 2. Check this alternative demo for support of vuetify 1.

Installation

npm i --save @koumoul/vuetify-jsonschema-form

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 '@koumoul/vuetify-jsonschema-form'
import '@koumoul/vuetify-jsonschema-form/dist/main.css'
import { Sketch } from 'vue-color'

Vue.use(Vuetify)
Vue.use(VueAxios, axios)

Vue.component('swatches', Swatches)
Vue.component('draggable', Draggable)
Vue.component('color-picker', Sketch)

export default {
  components: {VJsonschemaForm},
  data() {
    return {
      schema: {...},
      dataObject: {},
      formValid: false,
      options: {
        debug: false,
        disableAll: false,
        autoFoldObjects: true
      }
    }
  },
  methods: {
    showError(err) {
      window.alert(err)
    },
    showChange(e) {
      console.log('"change" event', e)
    },
    showInput(e) {
      console.log('"input" event', e)
    }
  }
}
</script>

The library can also be loaded from source if you use Vuetify "à la carte". In this case you will have to instruct your build tool to transpile the source with babel.

import VJsonschemaForm from '@koumoul/vuetify-jsonschema-form/lib/index.vue'

I you don't use a build tool, and want to load the library through script tags, you can do something like this.

...
<script src="https://cdn.jsdelivr.net/npm/@koumoul/vuetify-jsonschema-form@0.26/dist/main.js"></script>
<link href="https://cdn.jsdelivr.net/npm/@koumoul/vuetify-jsonschema-form@0.26/dist/main.css" rel="stylesheet">
...
<script>
  ...
  components: {
    "v-jsonschema-form": VJsonschemaForm.default
  }
  ...
</script>
0.36.4

4 years ago

0.36.3

4 years ago

0.36.2

4 years ago

0.36.0

5 years ago

0.35.0

5 years ago

0.34.0

5 years ago

0.32.1

5 years ago

0.32.0

5 years ago

0.31.1

5 years ago

0.31.0

5 years ago

0.30.0

5 years ago

0.29.2

5 years ago

0.29.1

5 years ago

0.29.0

5 years ago

0.28.3

5 years ago

0.28.2

5 years ago

0.28.1

5 years ago

0.28.0

5 years ago

0.27.1

5 years ago

0.27.0

5 years ago

0.26.1

5 years ago

0.26.0

5 years ago

0.25.1

5 years ago

0.25.0

5 years ago

0.24.3

5 years ago

0.24.2

5 years ago

0.24.1

5 years ago

0.24.0

5 years ago

0.23.1

5 years ago

0.23.0

5 years ago

0.22.0

5 years ago

0.21.0

5 years ago

0.20.1

5 years ago

0.20.0

5 years ago

0.19.1

5 years ago

0.19.0

5 years ago

0.18.2

5 years ago

0.18.1

5 years ago

0.18.0

5 years ago

0.17.10

5 years ago

0.17.9

5 years ago

0.17.8

5 years ago

0.17.7

5 years ago

0.17.6

5 years ago

0.17.5

5 years ago

0.17.4

5 years ago

0.17.3

5 years ago

0.17.2

5 years ago

0.17.1

5 years ago

0.17.0

5 years ago

0.16.0

5 years ago

0.15.0

5 years ago

0.14.3

5 years ago

0.14.2

5 years ago

0.14.1

5 years ago

0.14.0

5 years ago

0.13.2

5 years ago

0.13.1

5 years ago

0.13.0

5 years ago

0.12.0

5 years ago

0.11.0

5 years ago

0.10.1

5 years ago

0.10.0

5 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago