vue-form-making
A visual form designer/generator base on Vue.js, make form development simple and efficient.(基于Vue的可视化表单设计器,让表单开发简单而高效。)
Top Related Projects
JavaScript powered Forms with JSON Form Builder
Vue Forms ⚡️ Supercharged
Performance-focused API for React forms 🚀
Build forms in React, without the tears 😭
📋 React Hooks for form state management and validation (Web + React Native)
Simple, lightweight model-based validation for Vue.js
Quick Overview
Vue-form-making is a visual form designer and generator for Vue.js. It allows users to drag and drop components to create forms, generate corresponding Vue code, and export/import JSON schemas. This tool simplifies the process of building complex forms in Vue applications.
Pros
- Intuitive drag-and-drop interface for rapid form creation
- Supports a wide range of form components and layouts
- Generates clean, reusable Vue code
- Allows for easy form schema import/export
Cons
- Limited customization options for advanced use cases
- Documentation is primarily in Chinese, which may be challenging for non-Chinese speakers
- Dependency on Element UI may not fit all project requirements
- Some reported issues with responsiveness in complex forms
Code Examples
- Basic form creation:
<template>
<fm-generate-form
:data="formData"
:remote="remoteFuncs"
:value="formValues"
ref="generateForm"
/>
</template>
<script>
export default {
data() {
return {
formData: {},
formValues: {},
remoteFuncs: {}
}
},
methods: {
getData() {
this.$refs.generateForm.getData().then(data => {
// Handle form data
})
}
}
}
</script>
- Importing a form schema:
import { makeFormJson } from 'vue-form-making'
const formSchema = makeFormJson(jsonData)
- Exporting a form schema:
const jsonSchema = this.$refs.formDesigner.getJson()
Getting Started
-
Install the package:
npm install vue-form-making
-
Import and use in your Vue project:
import { FormDesigner, GenerateForm } from 'vue-form-making' import 'vue-form-making/dist/FormMaking.css' Vue.use(FormDesigner) Vue.use(GenerateForm)
-
Use the components in your Vue template:
<template> <fm-form-designer ref="formDesigner"/> <fm-generate-form :data="formData" ref="generateForm"/> </template>
Competitor Comparisons
JavaScript powered Forms with JSON Form Builder
Pros of formio.js
- More comprehensive and feature-rich form builder with advanced capabilities
- Supports multiple frameworks (React, Angular, Vue) and vanilla JavaScript
- Extensive documentation and active community support
Cons of formio.js
- Steeper learning curve due to its complexity and extensive features
- Larger file size and potential performance impact for simpler use cases
Code Comparison
formio.js:
Formio.createForm(document.getElementById('formio'), {
components: [
{ type: 'textfield', key: 'firstName', label: 'First Name' },
{ type: 'textfield', key: 'lastName', label: 'Last Name' },
{ type: 'button', action: 'submit', label: 'Submit' }
]
});
vue-form-making:
<template>
<fm-generate-form
:data="formData"
:remote="remoteFuncs"
@on-submit="handleSubmit"
/>
</template>
<script>
export default {
data() {
return {
formData: {
list: [
{ type: 'input', name: 'firstName', label: 'First Name' },
{ type: 'input', name: 'lastName', label: 'Last Name' }
]
}
}
}
}
</script>
Both libraries offer form-building capabilities, but formio.js provides a more extensive set of features and cross-framework support, while vue-form-making is specifically tailored for Vue.js applications with a simpler API.
Vue Forms ⚡️ Supercharged
Pros of FormKit
- More comprehensive and feature-rich form building solution
- Extensive documentation and community support
- Built-in validation and error handling capabilities
Cons of FormKit
- Steeper learning curve due to its extensive feature set
- Potentially heavier bundle size for simpler form requirements
Code Comparison
vue-form-making:
<template>
<form-making ref="formMaking" />
</template>
<script>
import FormMaking from 'vue-form-making'
</script>
FormKit:
<template>
<FormKit type="form" :actions="false">
<FormKit type="text" name="username" label="Username" />
<FormKit type="password" name="password" label="Password" />
</FormKit>
</template>
vue-form-making provides a drag-and-drop interface for form creation, while FormKit offers a more programmatic approach with pre-defined form elements. FormKit's code is more verbose but provides greater control over individual form fields and their properties.
Both libraries aim to simplify form creation in Vue applications, but they cater to different use cases. vue-form-making is ideal for quick, visual form building, while FormKit offers more flexibility and power for complex form requirements.
Performance-focused API for React forms 🚀
Pros of unform
- Built for React, offering seamless integration with React applications
- Supports schema validation out of the box using Yup
- Provides a more flexible and customizable approach to form building
Cons of unform
- Requires more manual setup and coding compared to vue-form-making
- Less visual drag-and-drop functionality for form creation
- Steeper learning curve for developers new to React or complex form handling
Code Comparison
vue-form-making:
<template>
<fm-generate-form
:data="jsonData"
:remote="remoteFuncs"
:value="formData"
ref="generateForm"
>
</fm-generate-form>
</template>
unform:
import { Form } from '@unform/web';
import Input from './components/Input';
function MyForm() {
return (
<Form onSubmit={handleSubmit}>
<Input name="email" />
<Input name="password" type="password" />
<button type="submit">Submit</button>
</Form>
);
}
vue-form-making provides a more declarative approach with a single component, while unform requires more manual setup but offers greater flexibility in form structure and field components.
Build forms in React, without the tears 😭
Pros of formik
- More mature and widely adopted in the React ecosystem
- Extensive documentation and community support
- Flexible and can be used with various UI libraries
Cons of formik
- Steeper learning curve for beginners
- Requires more manual setup compared to vue-form-making
- Limited visual form building capabilities
Code Comparison
formik:
import { Formik, Form, Field } from 'formik';
<Formik initialValues={{ name: '' }} onSubmit={handleSubmit}>
<Form>
<Field name="name" type="text" />
<button type="submit">Submit</button>
</Form>
</Formik>
vue-form-making:
<template>
<fm-generate-form :data="jsonData" ref="generateForm" @on-submit="handleSubmit">
<el-button type="primary" @click="submitForm">Submit</el-button>
</fm-generate-form>
</template>
<script>
export default {
data() {
return {
jsonData: { /* form configuration */ }
}
},
methods: {
submitForm() {
this.$refs.generateForm.getData().then(data => {
// Handle form data
})
}
}
}
</script>
📋 React Hooks for form state management and validation (Web + React Native)
Pros of react-hook-form
- Lightweight and performant, with minimal re-renders
- Extensive validation options and easy integration with UI libraries
- Strong TypeScript support and type inference
Cons of react-hook-form
- Steeper learning curve for developers new to React hooks
- Less visual form-building capabilities compared to vue-form-making
- Requires more manual setup for complex form layouts
Code Comparison
react-hook-form:
import { useForm } from "react-hook-form";
const { register, handleSubmit } = useForm();
const onSubmit = data => console.log(data);
<form onSubmit={handleSubmit(onSubmit)}>
<input {...register("firstName")} />
<input type="submit" />
</form>
vue-form-making:
<template>
<fm-generate-form
:data="jsonData"
:remote="remoteFuncs"
:value="formData"
ref="generateForm"
>
</fm-generate-form>
</template>
<script>
export default {
data() {
return {
jsonData: {},
formData: {}
}
}
}
</script>
react-hook-form focuses on programmatic form creation using React hooks, while vue-form-making provides a more visual, drag-and-drop approach to form building. react-hook-form offers more flexibility and control over form behavior, but requires more manual setup. vue-form-making simplifies the form creation process but may be less customizable for complex scenarios.
Simple, lightweight model-based validation for Vue.js
Pros of vuelidate
- Lightweight and flexible validation library
- Supports complex validation scenarios and custom validators
- Integrates well with existing Vue.js projects
Cons of vuelidate
- Requires more manual setup and configuration
- Less visual form-building capabilities
- Steeper learning curve for beginners
Code Comparison
vue-form-making:
<fm-generate-form :data="jsonData" :remote="remoteFuncs" ref="generateForm">
</fm-generate-form>
vuelidate:
<template>
<input v-model="$v.name.$model">
</template>
<script>
import { required, minLength } from 'vuelidate/lib/validators'
export default {
validations: {
name: {
required,
minLength: minLength(4)
}
}
}
</script>
vue-form-making focuses on visual form building with a drag-and-drop interface, generating JSON schemas for forms. It's ideal for rapid prototyping and non-technical users.
vuelidate is a more traditional validation library, offering granular control over validation rules and integration. It's better suited for developers who need fine-grained control over form validation in their Vue.js applications.
vue-form-making excels in quick form creation and visual editing, while vuelidate shines in complex validation scenarios and customization. The choice between them depends on the project's specific needs and the development team's preferences.
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
vue-form-making
ç®ä½ä¸æ | English
The FormMaking developed base on vue and element-ui, equipts with the latest front-end technology stack, built-in i18n internationalization solution, all of those are aimed at making developmemt simpler, and more efficiently.
This project is the base version, and if you need to experience the Advanced, you can go to the advanced version, which provides more components and functionality, add support Vue3.
- Preview
- Development
- Components
- MakingForm (Quickly design the form page based on the visual operation.)
- GenerateForm (The generator will render a form page quickly base on the configuration json data captured in the designer.)
- Secondary Development
Feature
- Visual configuration page
- Provide grid layout and align with flex
- One-click preview of configuration effects
- One-click generation of configuration json data
- One-click generate code, ready to run
- Provide custom components to meet user's custom requirements
- Provides a remote data interface for users to asynchronously fetch data
- Provides powerful advanced components
- Support for form validation
- Get form data quickly
- Internationalization support
Advanced version
The advanced version provides more functionality than the base version:
-
More beautiful pages;
-
Add fields quickly by clicking;
-
More property Settings, including data source and form events;
-
More control fields (subforms, custom components, etc.);
-
More layout containers and can be nested with each other (grids, tables, tabs);
-
More apis for more complex business needs;
-
Add custom fields, you can quickly introduce your own components;
-
Can quickly add custom styles;
-
Support data source, convenient form data configuration;
-
Support action events, which can make forms more flexible configuration;
-
Multi-terminal adaptation display;
-
Provides Ant Design-style components (modified by the introduction of ANTD Vue);
-
Support Vue3.
Third-party plug-ins
Browsers support
Modern browsers and Internet Explorer 10+.
IE / Edge | Firefox | Chrome | Safari |
---|---|---|---|
IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
Licenses
MIT
Top Related Projects
JavaScript powered Forms with JSON Form Builder
Vue Forms ⚡️ Supercharged
Performance-focused API for React forms 🚀
Build forms in React, without the tears 😭
📋 React Hooks for form state management and validation (Web + React Native)
Simple, lightweight model-based validation for Vue.js
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