DrawerFormLayout

DrawerFormLayout dùng để đặt biểu mẫu chuẩn trong drawer.

Cách dùng cơ bản

import { DrawerFormLayout } from '@nocobase/client-v2';

ctx.viewer.drawer({
  width: '50%',
  closable: true,
  content: () => (
    <DrawerFormLayout title={t('Add provider')} onSubmit={handleSubmit}>
      <Form form={form} layout="vertical">
        <Form.Item name="name" label={t('Name')} rules={[{ required: true }]}>
          <Input />
        </Form.Item>
      </Form>
    </DrawerFormLayout>
  ),
});

API

Tham sốKiểuMô tả
titleReact.ReactNodeTitle content
childrenReact.ReactNodeContent rendered inside the component
onSubmit`() => voidPromise`
submittingbooleanLoading state of the submit button
submitTextReact.ReactNodeSubmit button text
cancelTextReact.ReactNodeCancel button text
footerReact.ReactNodeReplace the default footer

Liên kết liên quan