Skip to content

Commit b2627ff

Browse files
authored
fix: add emptyText fieldItem props (#8888)
#8848
1 parent 43ceba3 commit b2627ff

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/form/src/components/Switch/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import React from 'react';
33
import type { ProFormFieldItemProps } from '../../typing';
44
import ProField from '../Field';
55

6-
export type ProFormSwitchProps = ProFormFieldItemProps<
7-
SwitchProps,
8-
HTMLElement
6+
export type ProFormSwitchProps = Omit<
7+
ProFormFieldItemProps<SwitchProps, HTMLElement>,
8+
'emptyText'
99
> & {
1010
checkedChildren?: SwitchProps['checkedChildren'];
1111
unCheckedChildren?: SwitchProps['unCheckedChildren'];

packages/form/src/typing.ts

+4
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ export type ProFormFieldItemProps<T = Record<string, any>, K = any> = {
128128
* @name 是否是次要控件,只针对 LightFilter 下有效
129129
*/
130130
secondary?: boolean;
131+
/**
132+
* @name 只读模式渲染文本,没有值的时候展示
133+
*/
134+
emptyText?: React.ReactNode;
131135
/**
132136
* @name 是否使用 swr 来缓存 缓存可能导致数据更新不及时,请谨慎使用,尤其是页面中多个组件 name 相同
133137
*

0 commit comments

Comments
 (0)