Giter Site home page Giter Site logo

openfext / vue-form-builder Goto Github PK

View Code? Open in Web Editor NEW
385.0 16.0 46.0 19.25 MB

Build powerful vue form with JSON schema and composition api.

Home Page: https://openfext.github.io/vue-form-builder

License: MIT License

JavaScript 54.11% Vue 45.32% CSS 0.57%
vue form form-builder form-schema form-generator json-form vue-form vue-form-builder vee-validate vue-composition-api vue-use vue-hooks composition-api json-schema element-ui iview viewui ant-design ant-design-vue vuetify

vue-form-builder's Introduction

Vue Form Builder

CircleCI codecov License Version PRs Welcome

Build powerful vue form with JSON schema and composition api. Any custom input components and popular ui frameworks such as Element UI, View UI, Ant Design Vue are supported.

🇺🇸 English | 🇨🇳 简体中文

Features

  • 📺 Powerful - use composition api to manage complex form state
  • 📷 Flexible - support any custom input components
  • Adaptable - different ui frameworks can be used out of the box through the adapters
  • 📻 Reliable - has been used in multiple applications in the production environment

Docs

🇨🇳 Chinese

🇺🇸 English

WIP...

Example

⚡ Live Preview | 📖 Element UI Storybook | 📖 View UI Storybook | 📖 Ant Design Storybook

Screen Capture

Contacts

Welcome to join the group chat to discuss project issues and front-end technologies 💬

QQ

ChatID: 667576147

QQGroupQRCode

WeChat Group

Add the author's WeChat to get into the group:

WeChatQRCode

Built With

License

MIT

Copyright (c) 2018 - present, Felix Yang

vue-form-builder's People

Contributors

felixpy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-form-builder's Issues

ElFormAdaptor无法使用

Bug Report

Affected Feature

真的很想知道为什么一直爆这个问题,抄的栗子还报这个错误
ElFormAdaptor
`
Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> at src/views/Home.vue
at src/App.vue

`
难道我的注册方法不对?

Is this a regression

Description

Minimal Reproduction

Exception or Error


Your Environment

Vue Version:


Vue Composition API:


Anything else relevant?

⚡ 技术交流讨论组

欢迎加入群聊讨论项目问题和前端技术 💬

QQ

群号:667576147

QQGroupQRCode

微信群

加作者微信进群:

WeChatQRCode

在JSON输入框中手动加入新的表单项,表单项无法正常输入

作者您好:

我clone了本项目中的/examples/simple-demo在本地运行起来之后。

往中间的JSON输入框中,手动新增了新的表单项。

//old
[
    {
        "tag": "el-input",
        "item": {
            "label": "标题"
        },
        "detail": {
            "name": "title",
            "defaultValue": "默认标题"
        }
    },
    {
        "tag": "el-input",
        "item": {
            "label": "描述"
        },
        "detail": {
            "type": "textarea",
            "name": "desc",
            "placeholder": "请填写一个精彩的描述",
            "rows": 3
        }
    },
    {
        "tag": "el-date-picker",
        "item": {
            "label": "日期"
        },
        "detail": {
            "name": "date",
            "placeholder": "请选择日期",
            "valueFormat": "yyyyMMdd"
        }
    },
    {
        "tag": "el-radio",
        "item": {
            "label": "地区"
        },
        "detail": {
            "name": "area",
            "items": [
                {
                    "text": "北京",
                    "label": "1"
                },
                {
                    "text": "上海",
                    "label": "2"
                },
                {
                    "text": "广州",
                    "label": "3"
                },
                {
                    "text": "深圳",
                    "label": "4"
                }
            ]
        }
    },
    {
        "tag": "el-checkbox",
        "item": {
            "label": "主题"
        },
        "detail": {
            "name": "subject",
            "items": [
                {
                    "text": "历史",
                    "label": "1"
                },
                {
                    "text": "战争",
                    "label": "2"
                },
                {
                    "text": "科幻",
                    "label": "3"
                },
                {
                    "text": "爱情",
                    "label": "4"
                },
                {
                    "text": "文艺",
                    "label": "5"
                },
                {
                    "text": "生活",
                    "label": "6"
                }
            ]
        }
    },
    {
        "tag": "el-select",
        "item": {
            "label": "标签"
        },
        "detail": {
            "name": "tag",
            "multiple": true,
            "items": [
                {
                    "label": "温暖",
                    "value": "1"
                },
                {
                    "label": "感动",
                    "value": "2"
                },
                {
                    "label": "刺激",
                    "value": "3"
                },
                {
                    "label": "紧张",
                    "value": "4"
                },
                {
                    "label": "有爱",
                    "value": "5"
                },
                {
                    "label": "搞笑",
                    "value": "6"
                }
            ]
        }
    }
]
//new
[
    {
        "tag": "el-input",
        "item": {
            "label": "标题"
        },
        "detail": {
            "name": "title",
            "defaultValue": "默认标题"
        }
    },
    {
        "tag": "el-input",
        "item": {
            "label": "描述"
        },
        "detail": {
            "type": "textarea",
            "name": "desc",
            "placeholder": "请填写一个精彩的描述",
            "rows": 3
        }
    },
    {
        "tag": "el-date-picker",
        "item": {
            "label": "日期"
        },
        "detail": {
            "name": "date",
            "placeholder": "请选择日期",
            "valueFormat": "yyyyMMdd"
        }
    },
    {
        "tag": "el-radio",
        "item": {
            "label": "地区"
        },
        "detail": {
            "name": "area",
            "items": [
                {
                    "text": "北京",
                    "label": "1"
                },
                {
                    "text": "上海",
                    "label": "2"
                },
                {
                    "text": "广州",
                    "label": "3"
                },
                {
                    "text": "深圳",
                    "label": "4"
                }
            ]
        }
    },
    {
        "tag": "el-checkbox",
        "item": {
            "label": "主题"
        },
        "detail": {
            "name": "subject",
            "items": [
                {
                    "text": "历史",
                    "label": "1"
                },
                {
                    "text": "战争",
                    "label": "2"
                },
                {
                    "text": "科幻",
                    "label": "3"
                },
                {
                    "text": "爱情",
                    "label": "4"
                },
                {
                    "text": "文艺",
                    "label": "5"
                },
                {
                    "text": "生活",
                    "label": "6"
                }
            ]
        }
    },
    {
        "tag": "el-select",
        "item": {
            "label": "标签"
        },
        "detail": {
            "name": "tag",
            "multiple": true,
            "items": [
                {
                    "label": "温暖",
                    "value": "1"
                },
                {
                    "label": "感动",
                    "value": "2"
                },
                {
                    "label": "刺激",
                    "value": "3"
                },
                {
                    "label": "紧张",
                    "value": "4"
                },
                {
                    "label": "有爱",
                    "value": "5"
                },
                {
                    "label": "搞笑",
                    "value": "6"
                }
            ]
        }
    },
   {
        "tag": "el-input",
        "item": {
            "label": "姓名"
        },
        "detail": {
            "name": "name"
        }
    }
]

结果发现新增的input无法正常输入,疑似双向绑定异常。

但是在您的在线预览中却不存在这个问题https://element-form-builder.now.sh/

期待得到您的恢复,谢谢...

config 中 rules 和 elements 为什么不分开传入?elements 为什么是数组?

config 中 rules 和 elements 为什么不分开传入?

rules 本身会预先配置,elements会存在二次操作。比如 select、radio、checkbox中的数据可能会异步获取。

elements 为什么是数组?

个人觉得应该设计成对象,方便之后修改数据。
伪代码

  <e-form
        v-model="formValues"
        :fields="fields"
        :rules="rules"/>
	  // 绑定字段
      formValues: {
        title: '',
		area: '',
  	   },
      // 字段配置
      fields: {
        title: {
          label: '标题',
        },
        area: {
          tag: 'el-radio',
          label: '地区',
          items: []
        },
      },
      // 字段校验
      rules: {
        title: { required: true, message: 'qdddd' }
      }
	 // fetch data
	 this.delay(2000).then(() => {
        const area = [
          { text: '西安', label: 2019 },
          { text: '杭州', label: 2018 },
          { text: '上海', label: 2017 }]

        this.fields.area.items = area
        this.formValues.area = area[0].label

      })

Fail to serve on NuxtJS

Bug Report

Description

The guideline seems broken on Nuxt setup.

Minimal Reproduction

Fresh project from yarn create nuxt-app, using options:

  • SSR
  • ElementUI

Exception or Error

Must use import to load ES Module: <skip>/node_modules/vue-runtime-helpers/dist/normalize-component.mjs

Updated on 14/11/2020:

  • Above exception can be resolved by adding the libraries to nuxt.config.js transpile section:
  build: {
    transpile: [
      /^element-ui/,
      /^vue-runtime-helpers/,
      /@fext\/vue-form-builder/,
      /@fext\/vue-use/,
    ],
  },

However, it seems the composition api not working correctly (this/context)

image

Your Environment

Vue Version:

2.6.11

Vue Composition API:

1.0.0-beta.10

NuxtJS Version

2.14.0

Node Version

v12.18.3

Which files do I modify to turn it into the demo?

Hi,

I ran the commands on terminal but I don't know which changes to make to which files to make it look like the live demo. Help greatly appreciated.

The project is running correctly on localhost with a login form but I don't know how to go from there to having the larger form from the example and the file to be edited to enable form changes.

Support Vuetify component framework

Feature Request

Relevant Package

Form Adaptor

Description

Support Vuetify since it is a very popular Material Design component framework.

Describe the solution you'd like

Add Vuetify component adapter.

Describe alternatives you've considered

Not yet.

can it support vuetify?

Feature Request

Relevant Package

Description

Describe the solution you'd like

Describe alternatives you've considered

Init with formValues

When I pass in v-model formValues with values the library empties them. I would like to be able to pass formValues with data. I have used the input event to make this mechanism, but I think the library should admit it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.