Top Related Projects
A powerful form designer for Vue.
f-render | 基于 ElementUI 的表单设计器
:fire::fire::fire: 强大的低代码动态表单组件,通过JSON数据驱动表单渲染,适配移动端,支持可视化设计。提高开发者对表单的开发效率。目前在政务系统、OA系统、ERP系统、电商系统、流程管理等系统中已稳定应用。
A visual form designer/generator base on Vue.js, make form development simple and efficient.(基于Vue的可视化表单设计器,让表单开发简单而高效。)
✅ Painless Vue forms
Quick Overview
Form-generator is a drag-and-drop form builder for Vue.js applications. It allows developers to create complex forms with a user-friendly interface, generating both the form's visual layout and the corresponding Vue code. This tool aims to simplify the process of form creation and management in Vue projects.
Pros
- Intuitive drag-and-drop interface for rapid form development
- Generates clean, reusable Vue code
- Supports a wide range of form elements and custom components
- Includes form validation and data binding features
Cons
- Limited to Vue.js framework, not suitable for other JavaScript frameworks
- May require additional customization for complex, unique form requirements
- Learning curve for understanding all available options and configurations
- Documentation is primarily in Chinese, which may be a barrier for non-Chinese speakers
Code Examples
- Basic form element creation:
<template>
<form-generator :schema="schema" v-model="formData" />
</template>
<script>
export default {
data() {
return {
schema: [
{ type: 'input', field: 'name', title: 'Name' },
{ type: 'select', field: 'country', title: 'Country', options: ['USA', 'Canada', 'UK'] }
],
formData: {}
}
}
}
</script>
- Adding form validation:
<template>
<form-generator :schema="schema" v-model="formData" :rules="rules" />
</template>
<script>
export default {
data() {
return {
schema: [
{ type: 'input', field: 'email', title: 'Email' }
],
formData: {},
rules: {
email: [
{ required: true, message: 'Email is required' },
{ type: 'email', message: 'Invalid email format' }
]
}
}
}
}
</script>
- Custom component integration:
<template>
<form-generator :schema="schema" v-model="formData">
<template #custom-component="{ field }">
<my-custom-component v-model="formData[field]" />
</template>
</form-generator>
</template>
<script>
import MyCustomComponent from './MyCustomComponent.vue'
export default {
components: { MyCustomComponent },
data() {
return {
schema: [
{ type: 'custom-component', field: 'customField', title: 'Custom Input' }
],
formData: {}
}
}
}
</script>
Getting Started
-
Install the package:
npm install @form-generator/vue
-
Import and use in your Vue component:
<template> <form-generator :schema="schema" v-model="formData" /> </template> <script> import FormGenerator from '@form-generator/vue' export default { components: { FormGenerator }, data() { return { schema: [ { type: 'input', field: 'username', title: 'Username' }, { type: 'password', field: 'password', title: 'Password' } ], formData: {} } } } </script>
-
Customize the form schema and add validation rules as needed.
Competitor Comparisons
A powerful form designer for Vue.
Pros of variant-form
- More extensive customization options for form layouts and styles
- Better support for complex, nested form structures
- Includes a visual form designer for easier form creation
Cons of variant-form
- Steeper learning curve due to more advanced features
- Less active community and fewer contributors
- Documentation is not as comprehensive as form-generator
Code Comparison
form-generator:
<el-form-item label="Input" prop="input">
<el-input v-model="formData.input"></el-input>
</el-form-item>
variant-form:
<vf-field-item :field="field" :designer="designer" :parent-widget="widget">
<vf-input-widget :field="field" :designer="designer" :parent-widget="widget" />
</vf-field-item>
Both projects aim to simplify form creation in Vue.js applications, but they differ in their approach and feature set. form-generator focuses on simplicity and ease of use, making it ideal for quick form prototyping and simpler use cases. variant-form, on the other hand, offers more advanced features and customization options, making it suitable for complex form scenarios but potentially more challenging for beginners.
f-render | 基于 ElementUI 的表单设计器
Pros of f-render
- More lightweight and focused on form rendering
- Simpler API and easier to integrate into existing projects
- Better support for custom components and layouts
Cons of f-render
- Less comprehensive documentation compared to form-generator
- Fewer built-in form components and validation rules
- Smaller community and fewer third-party extensions
Code Comparison
f-render:
<template>
<f-render :schema="schema" v-model="formData" />
</template>
<script>
export default {
data() {
return {
schema: { /* form schema */ },
formData: {}
}
}
}
</script>
form-generator:
<template>
<fm-generate-form
:data="formData"
:remote="remoteFuncs"
:value="formValues"
ref="generateForm"
/>
</template>
<script>
export default {
data() {
return {
formData: { /* form schema */ },
remoteFuncs: { /* remote functions */ },
formValues: {}
}
}
}
</script>
Both projects aim to simplify form creation in Vue.js applications, but they differ in their approach and feature set. f-render focuses on simplicity and flexibility, while form-generator offers a more comprehensive solution with additional built-in components and features. The choice between the two depends on the specific requirements of your project and the level of customization needed.
: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 forms
- Less focus on visual drag-and-drop form building
Code Comparison
form-create:
$formCreate([
{type: 'input', field: 'name', title: 'Name'},
{type: 'select', field: 'gender', title: 'Gender', options: [
{value: 'male', label: 'Male'},
{value: 'female', label: 'Female'}
]}
])
form-generator:
[
{type: 'el-input', label: 'Name', prop: 'name'},
{type: 'el-select', label: 'Gender', prop: 'gender', options: [
{value: 'male', label: 'Male'},
{value: 'female', label: 'Female'}
]}
]
Both libraries aim to simplify form creation in Vue.js applications, but they have different approaches. form-create offers more flexibility and supports multiple UI frameworks, while form-generator focuses on Element UI and provides a more straightforward API. The choice between the two depends on the specific project requirements and the developer's familiarity with the respective libraries.
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 out-of-the-box
- Includes a visual form designer for easier form creation
Cons of vue-form-making
- Less frequent updates and maintenance
- Smaller community and fewer contributors
- More complex setup and configuration process
Code Comparison
form-generator:
import { createGenerator } from '@form-generator/core'
const generator = createGenerator({
// Configuration options
})
vue-form-making:
import FormMaking from 'form-making'
import 'form-making/dist/FormMaking.css'
Vue.use(FormMaking)
Both projects aim to simplify form creation in Vue applications, but they differ in their approach and feature set. form-generator focuses on a more lightweight and flexible solution, while vue-form-making offers a more comprehensive toolkit with visual design capabilities.
form-generator provides a simpler API and is easier to integrate into existing projects. It also receives more frequent updates and has a larger community of contributors. However, it may require more manual configuration for complex forms.
vue-form-making, on the other hand, offers a visual form designer and a wider range of pre-built components, making it easier for non-technical users to create forms. However, it has a steeper learning curve and may be overkill for simpler projects.
Ultimately, the choice between these two libraries depends on the specific needs of your project and your team's expertise.
✅ Painless Vue forms
Pros of vee-validate
- Lightweight and focused on form validation
- Extensive documentation and community support
- Seamless integration with Vue.js ecosystem
Cons of vee-validate
- Limited to form validation, not a complete form generation solution
- Requires more manual setup for complex form scenarios
- Less visual customization options out-of-the-box
Code Comparison
vee-validate:
import { Form, Field, ErrorMessage } from 'vee-validate';
<Form @submit="onSubmit">
<Field name="email" as="input" type="email" />
<ErrorMessage name="email" />
<button type="submit">Submit</button>
</Form>
form-generator:
import FormGenerator from '@form-generator/core';
<FormGenerator
:schema="formSchema"
:model="formData"
@submit="handleSubmit"
/>
Summary
vee-validate is a lightweight form validation library for Vue.js, offering extensive documentation and seamless integration with the Vue ecosystem. It focuses solely on validation, requiring more manual setup for complex forms. form-generator, on the other hand, provides a more comprehensive form generation solution with visual customization options but may be overkill for simple validation tasks. The choice between the two depends on the specific project requirements and complexity of the forms needed.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
ç®ä»
Element UI表å设计å代ç çæå¨ï¼å¯å°çæç代ç ç´æ¥è¿è¡å¨åºäºElementçvue项ç®ä¸ï¼ä¹å¯å¯¼åºJSON表åï¼ä½¿ç¨é å¥ç解æå¨å°JSON解ææçå®ç表åã
- ãå½å é¢è§å°åã ãå½é é¢è§å°åã
- ãgithubä»åºã ã ç äºä»åºã
- é å¥vscodeæ件
- é å¥JSON解æå¨
ææ¡£
- el-dialogçå°è£ ä¸è°ç¨
- 项ç®ä¸»è¦ç»æåæ
- ã常è§é®é¢ãå¦ä½ä»¥npmçæ¹å¼éæmonacoç¼è¾å¨
- ç³»åæç¨ï¼ ã表åè®¾è®¡å¨ Â· å¼åæç¨ã ã表å解æå¨ Â· å¼åæç¨ã ãvue代ç çæå¨ Â· å¼åæç¨ã ãvue代ç é¢è§å¨ · å¼åæç¨ã
- JSON表ååæ°å¯¹ç §è¡¨
JSON解æå¨
å°ä¿åå¨æ°æ®åºä¸çJSON表åï¼è§£ææçå®ç表å
æ¥çå¨çº¿ç¤ºä¾
// å®è£
npm i form-gen-parser
vscodeæ件
帮å©ä½¿ç¨element UIçå¼åè
å®æåºæ¬ç表å代ç æ建任å¡ï¼åå°éå¤çå³å¨ã
vscode-pluginåæ¯é
å¥æ件为ï¼form-generator-pluginï¼
使ç¨æ件å¯å³é®æå¼è®¾è®¡å¨ï¼ç´æ¥å°ä»£ç ä¿åå°å·¥ç¨ä¸ã
å®è£
æ件请å¨vscodeä¸æç´¢ï¼
jakHuang
æ
Form Generator Plugin
è¿è¡
- ç¡®ä¿å·²ç»å®è£ node.js 10+
- é¦æ¬¡ä¸è½½é¡¹ç®åï¼å®è£ 项ç®ä¾èµï¼
yarn
æ
npm install
- æ¬å°å¼å
npm run dev
- æ建
npm run build
交æµ
- QQ群 976154366ã已满ã 1137173566ã已满ã 514953560ã3群ã
åæ é¾æ¥
- vue-admin-beautiful ââ ä¼ä¸çº§ãéç¨åä¸åå°å端解å³æ¹æ¡ï¼åºäºvue/cli 4 ææ°çï¼åæ¶æ¯æçµèï¼ææºï¼å¹³æ¿ï¼
- vue-admin-beautiful ââ å¨çº¿æ¼ç¤º
- pl-table ââ å®ç¾è§£å³ element ä¸çº§è¡¨æ ¼æ°æ®æ¸²æå¡é¡¿é®é¢
- go-admin
PR鸣谢
æèµ
å¦ææ¨è§å¾æ¬é¡¹ç®å¯¹æ¨æ帮å©ï¼å¯ä»¥è¯·ä½è åä¸æ¯åå¡, 让å¼æºèµ°çæ´è¿ï¼æè°¢æ¯æã
ä¹è¯·æ¨å¨æèµ åï¼å ä¸qq群ï¼976154366ï¼ç§è群主ç个èµå©é¾æ¥ã
å¼æºåè®®
Top Related Projects
A powerful form designer for Vue.
f-render | 基于 ElementUI 的表单设计器
:fire::fire::fire: 强大的低代码动态表单组件,通过JSON数据驱动表单渲染,适配移动端,支持可视化设计。提高开发者对表单的开发效率。目前在政务系统、OA系统、ERP系统、电商系统、流程管理等系统中已稳定应用。
A visual form designer/generator base on Vue.js, make form development simple and efficient.(基于Vue的可视化表单设计器,让表单开发简单而高效。)
✅ Painless Vue forms
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot