Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add emptyText fieldItem props #8888

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading