DrawerFormLayout

DrawerFormLayout digunakan untuk menempatkan formulir standar di drawer.

Penggunaan dasar

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

ParameterTipeDeskripsi
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

Tautan terkait