我正在开发一个使用schema.org的应用程序。我有以下一行:
<span itemProp="priceCurrency" content="EUR">€</span>
基于schema.org文档,content
属性是允许的。
注意,RDFa和微数据语法都允许使用"content="属性,用于发布简单的机器可读值以及更人性化的格式。
然而,我不知道如何修复这个TS错误:Property 'content' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>'
感谢您的任何建议!
这解决了ts错误:
declare module 'react' {
interface HTMLAttributes<T> {
// extends React's HTMLAttributes
content?: string;
}
}