gpt4 book ai didi

reactjs - react中的content属性怎么写?

转载 作者:行者123 更新时间:2023-12-02 16:55:27 24 4
gpt4 key购买 nike

这是我的代码

<div  itemProp={"offers"} itemScope  itemType={"http://schema.org/Offer"}>
<span itemProp="price" content="10.00">{10}</span>
</div>

我收到这个错误。

Type '{ children: string; itemProp: string; content: string; }' is not assignable to type 'DetailedHTMLProps, HTMLSpanElement>'. Property 'content' does not exist on type 'DetailedHTMLProps, HTMLSpanElement>'.

我觉得是内容的问题。

最佳答案

React Typescript - Adding custom attribute

 <div itemProp={"offers"} itemScope itemType={"http://schema.org/Offer"}>
<span itemProp="price" {...{content: '10.00'}}>
{10}
</span>
</div>

关于reactjs - react中的content属性怎么写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56609079/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com