Convert Figma logo to code with AI

Kchengz logok-form-design

基于vue Ant-Design 的表单设计器,快速开发

1,221
308
1,221
27

Top Related Projects

:fire::fire::fire: 强大的低代码动态表单组件,通过JSON数据驱动表单渲染,适配移动端,支持可视化设计。提高开发者对表单的开发效率。目前在政务系统、OA系统、ERP系统、电商系统、流程管理等系统中已稳定应用。

:sparkles:Element UI表单设计及代码生成器

A visual form designer/generator base on Vue.js, make form development simple and efficient.(基于Vue的可视化表单设计器,让表单开发简单而高效。)

A powerful form designer for Vue.

Quick Overview

K-form-design is a Vue-based drag-and-drop form builder that allows users to create dynamic forms easily. It provides a visual interface for designing forms with various input types and supports form validation, custom components, and data persistence.

Pros

  • Intuitive drag-and-drop interface for rapid form creation
  • Supports a wide range of form components and input types
  • Customizable themes and styles to match application design
  • Includes form validation and data submission capabilities

Cons

  • Limited documentation, especially for advanced features
  • Primarily focused on Vue.js, which may limit its use in other frameworks
  • Some reported issues with responsiveness on mobile devices
  • Relatively small community compared to more established form builders

Code Examples

  1. Basic form creation:
<template>
  <k-form-design ref="kfd" :value="formData" @submit="handleSubmit" />
</template>

<script>
export default {
  data() {
    return {
      formData: {}
    }
  },
  methods: {
    handleSubmit(data) {
      console.log('Form submitted:', data)
    }
  }
}
</script>
  1. Adding a custom component:
<template>
  <k-form-design ref="kfd">
    <template #customComponent>
      <k-form-item label="Custom Input" type="custom" name="customField">
        <a-input v-model="customValue" />
      </k-form-item>
    </template>
  </k-form-design>
</template>

<script>
export default {
  data() {
    return {
      customValue: ''
    }
  }
}
</script>
  1. Accessing form data programmatically:
export default {
  methods: {
    getFormData() {
      const formData = this.$refs.kfd.getData()
      console.log('Current form data:', formData)
    }
  }
}

Getting Started

  1. Install the package:

    npm install k-form-design
    
  2. Import and use in your Vue project:

    import KFormDesign from 'k-form-design'
    import 'k-form-design/lib/k-form-design.css'
    
    Vue.use(KFormDesign)
    
  3. Use the component in your template:

    <template>
      <k-form-design />
    </template>
    

Competitor Comparisons

:fire::fire::fire: 强大的低代码动态表单组件,通过JSON数据驱动表单渲染,适配移动端,支持可视化设计。提高开发者对表单的开发效率。目前在政务系统、OA系统、ERP系统、电商系统、流程管理等系统中已稳定应用。

Pros of form-create

  • More comprehensive documentation and examples
  • Supports multiple UI frameworks (Element UI, iView, Ant Design Vue)
  • Offers a wider range of form components and customization options

Cons of form-create

  • Steeper learning curve due to more complex API
  • Larger bundle size, which may impact performance for simpler projects
  • Less focus on drag-and-drop functionality compared to k-form-design

Code Comparison

k-form-design:

<k-form-design
  :value="formData"
  @submit="handleSubmit"
/>

form-create:

<form-create
  v-model="fApi"
  :rule="formRule"
  :option="formOption"
  @submit="handleSubmit"
/>

Both libraries aim to simplify form creation in Vue applications, but they have different approaches. k-form-design focuses on a user-friendly drag-and-drop interface, making it easier for non-technical users to create forms. form-create, on the other hand, provides more flexibility and power through its extensive API and support for multiple UI frameworks.

The choice between the two depends on the project requirements, team expertise, and the desired balance between ease of use and customization capabilities.

:sparkles:Element UI表单设计及代码生成器

Pros of form-generator

  • More comprehensive documentation and examples
  • Supports a wider range of form elements and customization options
  • Active community with frequent updates and contributions

Cons of form-generator

  • Steeper learning curve due to more complex features
  • Larger bundle size, which may impact performance in some applications
  • Less focus on mobile-friendly design out of the box

Code Comparison

k-form-design:

<k-form-design
  :value="formData"
  @submit="handleSubmit"
  ref="kfd"
/>

form-generator:

<fm-generate-form
  :data="formJson"
  :remote="remoteFuncs"
  :value="formData"
  ref="generateForm"
/>

Both libraries use a similar approach for rendering forms, but form-generator offers more advanced configuration options through its data and remote props. k-form-design focuses on simplicity and ease of use, while form-generator provides more flexibility for complex scenarios.

Overall, k-form-design is better suited for simpler projects or rapid prototyping, while form-generator excels in more complex, feature-rich applications that require extensive customization.

A visual form designer/generator base on Vue.js, make form development simple and efficient.(基于Vue的可视化表单设计器,让表单开发简单而高效。)

Pros of vue-form-making

  • More comprehensive documentation and examples
  • Supports a wider range of form components
  • Includes a visual form designer interface

Cons of vue-form-making

  • Less frequent updates and maintenance
  • Larger bundle size due to additional features
  • Steeper learning curve for beginners

Code Comparison

k-form-design:

<k-form-design
  :value="formData"
  @submit="handleSubmit"
  ref="kfd"
/>

vue-form-making:

<fm-generate-form
  :data="formData"
  :remote="remoteFuncs"
  @on-submit="handleSubmit"
/>

Both libraries offer similar core functionality for form generation, but vue-form-making provides more advanced features and customization options. k-form-design focuses on simplicity and ease of use, making it a good choice for smaller projects or developers new to form generation tools. vue-form-making is better suited for complex forms and applications requiring extensive customization, but may require more time to master.

When choosing between the two, consider your project's requirements, team expertise, and desired level of control over form design and functionality.

A powerful form designer for Vue.

Pros of variant-form

  • More extensive documentation and examples
  • Supports a wider range of form components and layouts
  • Active development with frequent updates

Cons of variant-form

  • Steeper learning curve due to more complex features
  • Larger bundle size, which may impact performance

Code Comparison

k-form-design:

<k-form-design
  :value="formData"
  @submit="handleSubmit"
>
  <!-- Form fields go here -->
</k-form-design>

variant-form:

<v-form-render
  :form-json="formJson"
  :form-data="formData"
  @form-submit="handleSubmit"
>
</v-form-render>

Both libraries offer Vue-based form builders, but variant-form provides a more feature-rich experience with advanced customization options. k-form-design, on the other hand, offers a simpler API and may be easier to integrate for basic form needs.

variant-form's extensive documentation and examples make it easier for developers to implement complex forms, while k-form-design's simplicity could be advantageous for smaller projects or teams with less experience in form building.

The code comparison shows that variant-form uses a JSON-based approach for form configuration, which allows for more flexibility but may require more setup. k-form-design's API is more straightforward, potentially leading to quicker implementation for simple forms.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

表单设计器 k-form-design

vue ant-design-vue license

感谢您的支持!由于已经将项目的重心转向 Vue 3 版本设计器,对于k-form-design项目决定暂停维护更新,欢迎您使用全新的 Vue3 版本设计器 epic-designer,以便享受到更多优化和功能!

简介

基于vue和ant-design-vue实现的表单设计器,样式使用less作为开发语言,主要功能是能通过简单操作来生成配置表单,生成可保存的JSON数据,并能将JSON还原成表单,使表单开发更简单更快速

特性

  • 可视化配置页面
  • 提供栅格、表格等布局
  • 布局嵌套使用
  • 提供预览、保存、生成json、生成可执行代码等操作
  • 支持表单验证
  • 快速获取表单数据
  • 自定义组件插入
  • 自定义主题色

组件

  • KFormDesign 表单设计器(基于可视化操作快速设计出表单页面,生成配置json或页面)
  • KFormBuild 表单构建器(根据设计器中获取的配置json数据,快速构建出表单页面)

安装

安装表单设计器

npm i k-form-design --save
 
# OR
yarn add k-form-design

安装 ant-design-vue UI ,推荐 vue2 版本最新的 1.7.8版本

npm i ant-design-vue@1.7.8 --save

# OR
yarn add ant-design-vue@1.7.8

引入组件

// 在main.js引入

// 注:useComponents 需放最上面,优先注册懒加载组件
import { useAntd } from 'k-form-design/packages/core/useComponents'
import KFormDesign from 'k-form-design/packages/use.js'
import 'k-form-design/lib/k-form-design.css'

useAntd(Vue)
Vue.use(KFormDesign)

使用组件

<template>
  <div>
   <k-form-design />
  </div>
</template>

交流

点击链接加入qq群聊

License

MIT Copyright (c) 2019 Kchengz

NPM DownloadsLast 30 Days