Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 样式化组件中的类型脚本(错误选择<;DetailedHTMLProps<;HTMLAttributes<;HtmlLevel>;)_Css_Typescript_Styled Components - Fatal编程技术网

Css 样式化组件中的类型脚本(错误选择<;DetailedHTMLProps<;HTMLAttributes<;HtmlLevel>;)

Css 样式化组件中的类型脚本(错误选择<;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}`}

我正在尝试使用带有样式化组件的typescript

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<...>'