Css 样式化组件中的类型脚本(错误选择<;DetailedHTMLProps<;HTMLAttributes<;HtmlLevel>;)
我正在尝试使用带有样式化组件的typescriptCss 样式化组件中的类型脚本(错误选择<;DetailedHTMLProps<;HTMLAttributes<;HtmlLevel>;),css,typescript,styled-components,Css,Typescript,Styled Components,我正在尝试使用带有样式化组件的typescript interface SomeDiv{ width: number | string; .... } const SomeDiv=styled.div` 身高:100%; 最小宽度:0; 网格列结束:${({width=1}):字符串=>`span${width}`}; 网格行结束:${({height=1}):字符串=>`span${height}`}; ${({order}):字符串=>order&&`order:${order}`}
interface SomeDiv{
width: number | string;
....
}
const SomeDiv=styled.div`
身高:100%;
最小宽度:0;
网格列结束:${({width=1}):字符串=>`span${width}`};
网格行结束:${({height=1}):字符串=>`span${height}`};
${({order}):字符串=>order&&`order:${order}`}
${({horizontal}):string=>horizontal&&`grid column start:${horizontal}`}
我有一个错误:
const SomeDiv = styled.div<SomeDiv>`
height: 100%;
min-width: 0;
grid-column-end: ${({ width = 1 }): string => `span ${width}`};
grid-row-end: ${({ height = 1 }): string => `span ${height}`};
${({ order }): string => order && `order: ${order}`}
${({ horizontal }): string => horizontal && `grid-column-start: ${horizontal}`}
类型上不存在属性“horizontal”
'选择&{…;}&ThemeProps'
你能发布完整的SomeDiv
界面吗?
Property 'horizontal' does not exist on type
'Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
"slot" | "style" | "title" | ... 251 more ... | "is"> & { ...; } & ThemeProps<...>'