Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

【Form 组件】新增 itemLayout 属性,实现表单项分列功能 #13

Closed
3 tasks done
dream2023 opened this issue Jun 14, 2021 · 0 comments · Fixed by #17
Closed
3 tasks done

【Form 组件】新增 itemLayout 属性,实现表单项分列功能 #13

dream2023 opened this issue Jun 14, 2021 · 0 comments · Fixed by #17
Labels
enhancement New feature or request
Milestone

Comments

@dream2023
Copy link
Owner

dream2023 commented Jun 14, 2021

新增 itemLayout 属性,实现表单项分列功能

说明

itemLayout 类型为数字,当为 1 时代表一列只有一个表单项,当为 2 时代表一列有 2 个表单项,以此类推,数字必须为 24 能除尽的数(24 栅格布局)。

使用方式

import React from 'react'
import { SuperEmail, SuperForm, SuperInput, SuperNumber } from 'super-antd';

const App = () =>{ 
  return <SuperForm
         itemLayout={3}
      >
        <SuperInput name="name" label="姓名"></SuperInput>
        <SuperNumber name="age" label="年龄"></SuperNumber>
        <SuperInput name="love" label="爱好"></SuperInput>
        <SuperEmail name="email" label="邮箱"></SuperEmail>
        <SuperInput name="address" label="地址"></SuperInput>
      </SuperForm>
}

表单项也可以自定义占用的自身的 itemLayout,例如:

<SuperInput name="name" label="姓名" itemLayout={2}></SuperInput>

特别注意

  • 当 form 设置了 itemLayout,则响应式失效;
  • 当 form 设置了 itemLayout,则 align 属性失效。

验收

  • 代码实现
  • 文档书写
  • 单元测试
@dream2023 dream2023 added the enhancement New feature or request label Jun 14, 2021
@dream2023 dream2023 added this to the 1.0 milestone Jun 14, 2021
@dream2023 dream2023 linked a pull request Jul 11, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant