DouyinFE / semi-design

🚀A modern, comprehensive, flexible design system and React UI library. 🎨 Provide more than 3000+ Design Tokens, easy to build your design system. Make Semi Design to Any Design. 🧑🏻‍💻 Design to Code in one click
https://semi.design
Other
8.43k stars 711 forks source link

[Chore] FormApi ts type define #933

Closed pointhalo closed 2 years ago

pointhalo commented 2 years ago

Which Component Need Enhancement 期望新增功能的组件

What does the proposed API look like 期望支持的API

Feature Description 功能描述

因为 BaseFormApi的定义是这样写的,继承自 Record<string, unknown> image

Additional information 补充说明

interface FData {
    test: boolean;
    test2: boolean;
    test3: string;
    // [x: string]: unknown;
}
class Demo extends React.Component<IProps> {
    constructor(props:any) {
      super(props);
      this.state = { visible: false};
    }

    getFormApi(formApi: FormApi<FData>) {
        formApi.getValue('')
    }

    render() {
      const { visible } = this.state;
      return (
        <>
          <Form getFormApi={this.getFormApi}>
          </Form>
        </>
      );
    }
  }
so2liu commented 2 years ago

为啥关了呀,是已经修了吗?感觉这个严重影响 ts 开发者的使用

pointhalo commented 2 years ago

在2.14.0已更新

image