From be23de6900b216de1e30f7a17ad919e2dd7b1e4d Mon Sep 17 00:00:00 2001 From: zhangfisher Date: Fri, 7 Jun 2024 15:46:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4getStyle=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0style=E7=B1=BB=E5=9E=8B=E4=B8=BACSSProperties?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.md | 6 ++++++ src/types.ts | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 6123d10..81fd2af 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,11 @@ # flexstyled +## 2.1.1 + +### Patch Changes + +- 776f359: 修改`getStyle`的`style`参数类型为`CSSProperties` + ## 2.1.0 ### Minor Changes diff --git a/src/types.ts b/src/types.ts index 5c51f43..b66e293 100644 --- a/src/types.ts +++ b/src/types.ts @@ -21,8 +21,8 @@ export interface IStyledObject { className : string vars : CSSVars computedStyles: ComputedStyles - getStyle : (props?:any,style?:CSSRuleObject)=>CSSProperties - getProps : (params?:{style?:CSSRuleObject,props?:any,className?:string})=>StyledResult; + getStyle : (props?:any,style?:CSSProperties)=>CSSProperties + getProps : (params?:{style?:CSSProperties,props?:any,className?:string})=>StyledResult; } @@ -30,8 +30,8 @@ export type StyledObject= IStyle // 传递给组件时,不需要额外传递props,并且getStyle的签名也需要做相应调整 export type ComponentStyledObject = Omit & { - getStyle : (props?:any,style?:CSSRuleObject)=>CSSProperties - getProps :(params?:{style?:CSSRuleObject,className?:string})=>StyledResult + getStyle : (props?:any,style?:CSSProperties)=>CSSProperties + getProps :(params?:{style?:CSSProperties,className?:string})=>StyledResult }