DrawerFormLayout

DrawerFormLayout は、drawer に標準フォームを配置するためのコンポーネントです。

基本的な使い方

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

パラメータ説明
titleReact.ReactNodeタイトル内容
childrenReact.ReactNodeコンポーネント内に描画する内容
onSubmit`() => voidPromise`
submittingbooleanSubmit ボタンの loading 状態
submitTextReact.ReactNodeSubmit ボタンの文言
cancelTextReact.ReactNodeCancel ボタンの文言
footerReact.ReactNodeデフォルト footer を置き換える

関連リンク