好烦,开始搞ts了
报错内容:不能将类型“{ children: Element; border: string; }”分配给类型“DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>”。
类型“DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>”上不存在属性“border”
解决办法改接口把border加上
interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
cellPadding?: number | string | undefined;
cellSpacing?: number | string | undefined;
summary?: string | undefined;
width?: number | string | undefined;
border?: number | string | undefined;
}