All Projects → jarvelov → Vue Form Json Schema

jarvelov / Vue Form Json Schema

Create forms using JSON schema. Bring your components!

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Form Json Schema

Vue Form Generator
📋 A schema-based form generator component for Vue.js
Stars: ✭ 2,853 (+1027.67%)
Mutual labels:  schema, generator, form, vuejs2
Vue Touch Ripple
👆 Touch ripple component for @vuejs
Stars: ✭ 443 (+75.1%)
Mutual labels:  vue-components, vue-component, vuejs2, vue2
Quasar
Quasar Framework - Build high-performance VueJS user interfaces in record time
Stars: ✭ 20,090 (+7840.71%)
Mutual labels:  vue-components, vue-component, vuejs2, vue2
Vue Awesome Swiper
🏆 Swiper component for @vuejs
Stars: ✭ 12,072 (+4671.54%)
Mutual labels:  vue-components, vue-component, vuejs2, vue2
Vue Share Buttons
🔗A set of social buttons for Vue.js
Stars: ✭ 34 (-86.56%)
Mutual labels:  component, vue-components, vuejs2, vue2
Vue Codemirror
⌨️ @codemirror component for @vuejs
Stars: ✭ 2,115 (+735.97%)
Mutual labels:  vue-components, vue-component, vuejs2, vue2
Native
Generate a form using JSON Schema and Vue.js
Stars: ✭ 382 (+50.99%)
Mutual labels:  json, schema, component, form
vue-notification-bell
Vue.js notification bell component.
Stars: ✭ 64 (-74.7%)
Mutual labels:  vuejs2, vue-components, vue2, vue-component
Semantic Ui Vue
Semantic UI integration for Vue
Stars: ✭ 914 (+261.26%)
Mutual labels:  components, vue-components, vuejs2, vue2
Vue Quill Editor
🍡@quilljs editor component for @vuejs
Stars: ✭ 6,874 (+2617%)
Mutual labels:  vue-components, vue-component, vuejs2, vue2
Vue Marquee Text Component
[CSS GPU Animation] Marquee Text for vuejs
Stars: ✭ 226 (-10.67%)
Mutual labels:  component, vue-component, vuejs2, vue2
Xcui
🍴 A Vue.js 2.x desktop components colletion
Stars: ✭ 88 (-65.22%)
Mutual labels:  vue-components, vue-component, vuejs2, vue2
Vue Video Player
🎞 @videojs component for @vuejs
Stars: ✭ 4,026 (+1491.3%)
Mutual labels:  vue-components, vue-component, vuejs2, vue2
Vuesax
New Framework Components for Vue.js 2
Stars: ✭ 5,293 (+1992.09%)
Mutual labels:  component, vue-components, vuejs2, vue2
Vue Particles
Vue.js component for particles backgrounds ✨
Stars: ✭ 1,220 (+382.21%)
Mutual labels:  vue-components, vue-component, vuejs2, vue2
V Bar
The virtual responsive crossbrowser scrollbar component for VueJS 2x
Stars: ✭ 216 (-14.62%)
Mutual labels:  component, vue-components, vuejs2, vue2
Thorui Uniapp
ThorUI组件库,轻量、简洁的移动端组件库。组件文档地址:https://thorui.cn/doc/ 。 最近更新时间:2021-10-01
Stars: ✭ 1,842 (+628.06%)
Mutual labels:  component, components, vue-component
Typedload
Python library to load dynamically typed data into statically typed data structures
Stars: ✭ 120 (-52.57%)
Mutual labels:  json-schema, json, schema
Vue Ui For Pc
基于Vue2.x的一套PC端UI组件,包括了Carousel 跑马灯、Cascader 级联、Checkbox 多选框、Collapse 折叠面板、DatePicker 日期选择、Dialog 对话框、Form 表单、Input 输入框、InputNumber 数字输入框、Layer 弹窗层、Loading 加载、Menu 菜单、Page 分页、Progress 进度条、Radio 单选框、SelectDropDown 仿select、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 文字提示、BackTop 返回顶部、steps 步骤条、Transfer 穿梭框、Tree 树形、Upload 文件上传、Lazy 图片懒加载、Loading 加载、Pagination 分页等等
Stars: ✭ 156 (-38.34%)
Mutual labels:  vue-components, form, vuejs2
Vuetify Form Base
Schema-based Form Generator - Vue.js 2.0 Component based on Vuetify 2.0
Stars: ✭ 157 (-37.94%)
Mutual labels:  generator, form, vue-component

Vue Form JSON Schema

A JSON schema based form generator, bring your components!

Use any Vue component or HTML element!

There are no prebuilt components for you to puzzle your form together with. Instead you can use any component or element which emits an event, custom or native.

Note that essentially all Vue components that uses v-model emits an input (or similar) event. See Vue's guide for more info

Installation

Upgrading from v1? Check out the v2 release notes to see if and how migration affects you.

Install from npm

npm install vue-form-json-schema

Import to your app

import Vue from 'vue';
import VueFormJsonSchema from 'vue-form-json-schema';

Vue.component('vue-form-json-schema', VueFormJsonSchema);

Note if you're not using Webpack / Rollup and want to use the ESM version you need to import VueFormJsonSchema like this:

import VueFormJsonSchema from 'vue-form-json-schema/dist/vue-form-json-schema.esm.js';

Check out the demos or see a minimal example in the usage instructions to get started.

UMD

If you're using the UMD version you can find more examples in the examples folder of the github repo and the UMD demo below.

If you want to use vue-form-json-schema directly in a browser you can do so by using the UMD version. The UMD version autoinstalls the vue-form-json-schema component if Vue is found on the window. The entire module is also available on window.VueFormJsonSchema where the named exports such as for example vfjsFieldMixin can be accessed.

Hosted by unkpg

<script src="https://unpkg.com/[email protected]/dist/vue-form-json-schema.umd.js"></script>

You can substite [email protected] to a fixed version, such as [email protected]

Installed from npm

<script src="../node_modules/dist/vue-form-json-schema.umd.js"></script>

Demo

Note that all demos use Bootstrap styling, but no styling is included in this package and it is up to you what styles should be used.

Minimal demo

The least amount of configuration to render an input element.

Nested UI demo

Using Bootstrap classes to show how layout can be different for devices with different screen sizes. In this example two input fields will be wrapped inside a div with col-12 col-sm-6 classes. Try resizing your browser window too see it in action.

Conditional visibility and Animation demo

Sometimes a field should only be shown if a condition is met. Uses <transition> to provide animation.

Vue components demo

See how to use your own or third party Vue components in vue-form-json-schema.

Vue async loading of form

Loading the form from a backend? Check out this example.

Registration form with validation

A more complete example with validation and error messages

Registration form example with nested properties

The registration form above where the form model keys are nested under another key

UMD demos

All the examples above are replicated using the UMD version in the examples folder of this repo.

Online version of the first demo

Features

  • Supports any HTML element or Vue component
  • Small (32K uncompressed, 6.5K gzipped)
  • Standardized JSON schema for annotation and validation (by Ajv)
  • Layout is independent from data structure

Documentation

Gitbook

Usage

Basic example with one field

For using the UMD version, check out the examples folder where all the demos above are replicated using the UMD version

See demo

<template>
    <vue-form-json-schema
      v-model="model"
      :schema="schema"
      :ui-schema="uiSchema"
    >
  </vue-form-json-schema>
</template>

<script>
  export default {
    data() {
      return {
        // An object which holds the form values
        model: {},
        // A valid JSON Schema object
        schema: {
          type: 'object',
          properties: {
            firstName: {
              type: 'string',
            },
          },
        },
        // Array of HTML elements or Vue components
        uiSchema: [{
          component: 'input',
          model: 'firstName',
          // Same API as [Vue's render functions](https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth)
          fieldOptions: {
            class: ['form-control'],
            on: ['input'],
            attrs: {
              placeholder: 'Please enter your first name',
            },
          },
        }],
      };
    }
  };
</script>

Dependencies

Ajv

For form validation using JSON Schema and internal validation

Lodash

get, set and merge are used throughout the package. Bundle size is very important though and is always considered and so we heavily strip down lodash to only include the absolute necessities

Vue

Tested with v2.5.9 but will probably work on any version >= v2.4.0

TODO

  • Write tests
  • Add i18n support
    • Added in 1.15.2 with options.ajv.locale setting
  • Write this README
  • Use Ajv internally to validate:
    • vfs-global prop ui-schema
    • vfs-component prop ui-schema
  • Write docs
  • Publish with Gitbook
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].