Skip to content

Muluk-m/schema-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v3-schema-form

npm

基于 JSON Schema 规范的表单生成器,适用于 vue3

Features

  • 🚀 快速搭建
  • 🪒 完整的表单校验
  • ⚙️ 灵活的表单联动
  • 🪜 高拓展性的组件注册

Usage

<script setup>
import { ref } from 'vue';
import SchemaForm from 'v3-schema-form';

const formData = ref({
  userName: '王小明',
  age: 18,
  bio: '酷!',
});

const schema = {
  type: 'object',
  properties: {
    userName: {
      type: 'string',
      title: '用户名',
      required: true,
    },
    age: {
      type: 'number',
      title: '年龄',
    },
    bio: {
      type: 'string',
      title: '签名',
    },
  },
};
</script>

<template>
  <SchemaForm v-model="formData" :schema="schema" />
</template>

demo

Installation

npm

npm install v3-schema-form --save