Skip to content

Commit

Permalink
fix: fieldSet test
Browse files Browse the repository at this point in the history
  • Loading branch information
liquanwei.lqw committed Nov 22, 2024
1 parent 6be9e51 commit 1500dd4
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions packages/form/src/components/Rate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { RateProps } from 'antd';
import React from 'react';
import type { ProFormFieldItemProps } from '../../typing';
import ProField from '../Field';
import { ProConfigProvider } from '@ant-design/pro-provider';
import { FieldRate } from '@ant-design/pro-field';
/**
* 评分组件
*
Expand All @@ -12,16 +14,25 @@ const ProFormRate: React.ForwardRefRenderFunction<
ProFormFieldItemProps<RateProps>
> = ({ fieldProps, proFieldProps, ...rest }, ref) => {
return (
<ProField
valueType="rate"
fieldProps={fieldProps}
ref={ref}
proFieldProps={proFieldProps}
filedConfig={{
ignoreWidth: true,
<ProConfigProvider
valueTypeMap={{
rate: {
render: (text, props) => <FieldRate {...props} text={text} />,
formItemRender: (text, props) => <FieldRate {...props} text={text} />,
},
}}
{...rest}
/>
>
<ProField
valueType="rate"
fieldProps={fieldProps}
ref={ref}
proFieldProps={proFieldProps}
filedConfig={{
ignoreWidth: true,
}}
{...rest}
/>
</ProConfigProvider>
);
};

Expand Down

0 comments on commit 1500dd4

Please sign in to comment.