Skip to content

Commit

Permalink
fix: add emptyText fieldItem props
Browse files Browse the repository at this point in the history
  • Loading branch information
cycleccc committed Nov 22, 2024
1 parent d0f573f commit 1530ae8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/form/src/components/Switch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import React from 'react';
import type { ProFormFieldItemProps } from '../../typing';
import ProField from '../Field';

export type ProFormSwitchProps = ProFormFieldItemProps<
SwitchProps,
HTMLElement
export type ProFormSwitchProps = Omit<
ProFormFieldItemProps<SwitchProps, HTMLElement>,
'emptyText'
> & {
checkedChildren?: SwitchProps['checkedChildren'];
unCheckedChildren?: SwitchProps['unCheckedChildren'];
Expand Down
4 changes: 4 additions & 0 deletions packages/form/src/typing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export type ProFormFieldItemProps<T = Record<string, any>, K = any> = {
* @name 是否是次要控件,只针对 LightFilter 下有效
*/
secondary?: boolean;
/**
* @name 只读模式渲染文本,没有值的时候展示
*/
emptyText?: React.ReactNode;
/**
* @name 是否使用 swr 来缓存 缓存可能导致数据更新不及时,请谨慎使用,尤其是页面中多个组件 name 相同
*
Expand Down

0 comments on commit 1530ae8

Please sign in to comment.