Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: form #338

Merged
merged 23 commits into from
Nov 17, 2022
Merged

fix: form #338

merged 23 commits into from
Nov 17, 2022

Conversation

jc9702507
Copy link
Collaborator

修改form:

  • 更方便的用法
  • 更多的功能,包括表单校验方式
  • 输入组件跟表单组件非强耦合
  • 方便用户自定义组件接入
<form-input
  label="用户名"
  name="account"
  ref="handleRef"
/>

<form-input
  label="地址"
  name="address"
  ref="handleRef"
/>

<button type="primary" onTap="submit">提交</button>
<button onTap="reset">重置</button>
import { Form } from 'antd-mini';


Page({
  form: new Form(),
  handleRef(ref) {
    this.form.addItem(ref);
  },
  reset() {
    this.form.reset();
  },
  async submit() {
    const values = await this.form.submit();
    console.log(values);
  }
});

@jc9702507 jc9702507 changed the title [WIP] fix: form fix: form Nov 17, 2022
@wyj580231 wyj580231 merged commit 94c2e31 into next Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants