Skip to content

Commit

Permalink
fix: 修改传参数写法
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Millent committed Oct 18, 2023
1 parent ef89e84 commit 843da1c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rate/Rate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface RateProps extends TdRateProps, StyledProps {}

// 评分图标
// fix: 2550
const RateIcon = ({ props, icon }) => {
const RateIcon = ({ icon, ...props }) => {
const { StarFilledIcon } = useGlobalIcon({ StarFilledIcon: TdStarFilledIcon });
if (React.isValidElement(icon)) {
return React.cloneElement(icon, props);
Expand Down Expand Up @@ -88,19 +88,19 @@ const Rate = forwardRef((props: RateProps, ref: React.Ref<HTMLDivElement>) => {
{showText ? (
<TooltipLite key={index} content={texts[displayValue - 1]}>
<div className={`${classPrefix}-rate__star-top`}>
<RateIcon props={{ size, color: activeColor }} icon={icon} />
<RateIcon size={size} color={activeColor} icon={icon} />
</div>
<div className={`${classPrefix}-rate__star-bottom`}>
<RateIcon props={{ size, color: defaultColor }} icon={icon} />
<RateIcon size={size} color={defaultColor} icon={icon} />
</div>
</TooltipLite>
) : (
<>
<div className={`${classPrefix}-rate__star-top`}>
<RateIcon props={{ size, color: activeColor }} icon={icon} />
<RateIcon size={size} color={activeColor} icon={icon} />
</div>
<div className={`${classPrefix}-rate__star-bottom`}>
<RateIcon props={{ size, color: defaultColor }} icon={icon} />
<RateIcon size={size} color={defaultColor} icon={icon} />
</div>
</>
)}
Expand Down

0 comments on commit 843da1c

Please sign in to comment.