소스 검색

fix: when borderRaidus is a string, the component displays an exception (#4102)

Vben 7 달 전
부모
커밋
344c499462
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      packages/effects/hooks/src/use-design-tokens.ts

+ 3 - 1
packages/effects/hooks/src/use-design-tokens.ts

@@ -56,7 +56,9 @@ export function useAntdDesignTokens() {
 
       tokens.colorBgBase = getCssVariableValue('--background');
 
-      tokens.borderRadius = getCssVariableValue('--radius', false);
+      const radius = Number.parseFloat(getCssVariableValue('--radius', false));
+      // 1rem = 16px
+      tokens.borderRadius = radius * 16;
 
       tokens.colorBgLayout = getCssVariableValue('--background-deep');
       tokens.colorBgMask = getCssVariableValue('--overlay');