diff --git a/packages/amis-core/src/factory.tsx b/packages/amis-core/src/factory.tsx index 25e3e1c3b..285e093e3 100644 --- a/packages/amis-core/src/factory.tsx +++ b/packages/amis-core/src/factory.tsx @@ -73,6 +73,9 @@ export interface RendererProps extends ThemeProps, LocaleProps, OnEventProps { }; defaultData?: object; className?: any; + style?: { + [propName: string]: any; + }; [propName: string]: any; } diff --git a/packages/amis-core/src/theme.tsx b/packages/amis-core/src/theme.tsx index 682a18369..e4f4241df 100644 --- a/packages/amis-core/src/theme.tsx +++ b/packages/amis-core/src/theme.tsx @@ -122,7 +122,9 @@ export function getTheme(theme: string): ThemeInstance { export interface ThemeProps { className?: string; - style?: any; + style?: { + [propName: string]: any; + }; classPrefix: string; classnames: ClassNamesFn; theme?: string; @@ -131,7 +133,9 @@ export interface ThemeProps { export interface ThemeOutterProps { theme?: string; className?: string; - style?: any; + style?: { + [propName: string]: any; + }; classPrefix?: string; classnames?: ClassNamesFn; } diff --git a/packages/amis-ui/src/components/ListGroup.tsx b/packages/amis-ui/src/components/ListGroup.tsx index 4e8b888fa..5f1bb83bd 100644 --- a/packages/amis-ui/src/components/ListGroup.tsx +++ b/packages/amis-ui/src/components/ListGroup.tsx @@ -7,6 +7,9 @@ export interface ListGroupProps expand?: boolean; items?: Array; itemClassName?: string; + style?: { + [propName: string]: any; + }; itemRender: (item: any, index: number) => JSX.Element; placeholder?: JSX.Element; getItemProps?: (props: {item: any; index: number}) => any; diff --git a/packages/amis/src/renderers/Form/InputCity.tsx b/packages/amis/src/renderers/Form/InputCity.tsx index f353584f0..d8b4802d0 100644 --- a/packages/amis/src/renderers/Form/InputCity.tsx +++ b/packages/amis/src/renderers/Form/InputCity.tsx @@ -75,7 +75,9 @@ export interface CityPickerProps allowDistrict: boolean; allowStreet: boolean; useMobileUI?: boolean; - style?: any; + style?: { + [propName: string]: any; + }; } export interface CityDb { diff --git a/packages/amis/src/renderers/Portlet.tsx b/packages/amis/src/renderers/Portlet.tsx index 04a5eb81c..dc5a3e6bc 100644 --- a/packages/amis/src/renderers/Portlet.tsx +++ b/packages/amis/src/renderers/Portlet.tsx @@ -144,11 +144,9 @@ export interface PortletSchema extends Omit { /** * 自定义样式 */ - style?: - | string - | { - [propName: string]: any; - }; + style?: { + [propName: string]: any; + }; } export interface PortletProps diff --git a/packages/amis/src/renderers/Tag.tsx b/packages/amis/src/renderers/Tag.tsx index b59deb594..942077237 100644 --- a/packages/amis/src/renderers/Tag.tsx +++ b/packages/amis/src/renderers/Tag.tsx @@ -22,7 +22,9 @@ export interface TagSchema extends BaseSchema { /** * 自定义样式 */ - style?: React.CSSProperties; + style?: { + [propName: string]: any; + }; /** * 标签颜色 diff --git a/packages/amis/src/renderers/Video.tsx b/packages/amis/src/renderers/Video.tsx index f12124fec..8d74bfaeb 100644 --- a/packages/amis/src/renderers/Video.tsx +++ b/packages/amis/src/renderers/Video.tsx @@ -57,7 +57,9 @@ export interface VideoSchema extends BaseSchema { framesClassName?: SchemaClassName; // 用于设置行内样式 - style?: any; + style?: { + [propName: string]: any; + }; /** * 如果是实时的,请标记一下