yyl-form
v0.2.6
Published
## 动态表单
Readme
yyl-form
动态表单
npm i yyl-formFirst step
import YylFrom from 'YylFrom'Sec step
const data = [
{ label: '开关', key: 'switch', type: 'switch' },
{ label: '开关', key: 'switch1', type: 'switch' },
{ label: '多选框', key: 'checkbox', type: 'checkbox', options: ['选项一', '选项二'] },
{ label: '单选框', key: 'radio', type: 'radio', options: ['选项一', '选项二'] },
{ label: '输入框', key: 'input', type: 'input', placeholder: '请输入内容', rules: { required: true, message: '请输入内容' } },
{ label: '日期选择器', key: 'date', type: 'date' }
]
const submitForm = value => {
console.log(value)
}Third step
<yyl-from :formList="data" @submitForm="submitForm"></ytl-from>