- Notifications
You must be signed in to change notification settings - Fork54
Vue dynamic nested form component, support nested Object/Hashmap/Array. Vue动态多级表单组件,支持嵌套对象/Hashmap/数组。
License
chenquincy/vue-dynamic-form-component
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
vue-dynamic-form-component is a dynamic form component base onelement-ui andasync-validator. You just need to writedescriptors(reference toasync-validator) of the data you want,vue-dynamic-form-component will generate the form automatically.
<template> <dynamic-formref="dynamic-form"v-model="data":descriptors="descriptors"> <template slot="operations"> <el-button@click="reset">reset</el-button> <el-buttontype="primary"@click="validate">validate</el-button> </template> </dynamic-form></template><script>// import and register element-ui firstimportDynamicFormfrom'vue-dynamic-form-component'exportdefault { components: { DynamicForm },data () {return { descriptors: { name: { type:'string', min:3, max:15, required:true }, homepage: { type:'url', message:'The homepage must be an url' }, company: { type:'object', fields: { name: { type:'string', required:true }, address: { type:'object', fields: { province: { type:'string', required:true }, city: { type:'string' } } } } }, children: { type:'array', defaultField: { type:'object', fields:{ name: { type:'string', min:3, max:15, required:true }, age: { type:'number', min:1, max:100, required:true } } } } }, data: {} } }, methods: {reset () {this.$refs['dynamic-form'].resetFields() },validate () {this.$refs['dynamic-form'].validate() } }}</script>
- Generate form fromdescriptors
- Support almost all data type
- Supportmulti-level form for
Object
/Array
/Hashmap
- Support datavalidation
- Multi-Languages support
- Supportcustom component
vue-dynamic-form-component can do more. There are a few things that it currently doesn't support but are planned:
- Custom component props
- Custom component event
- Custom component
- Custom theme
- Value change event
Please submit your question inGithub Issue .
About
Vue dynamic nested form component, support nested Object/Hashmap/Array. Vue动态多级表单组件,支持嵌套对象/Hashmap/数组。
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.