有人尝试在react项目中实现吗? github / npm网站上的文档中没有太多内容。当我尝试注入数据时,是否存在添加graphql数据的特定方法?
JSX:
<JSONLD>
<Generic jsonldtype="event" schema={{
name: "${adv_event.title}",
description: "${adv_event.body}",
startDate: "YYYY-MM-DDT:HH:MM",
endDate: "YYYY-MM-DDT:HH:MM",
image: "",
}}>
<Generic type="location" jsonldtype="Place" schema={{ name: "test", }}/>
</Generic>
</JSONLD>
我尝试过的:
name: "${adv_event.title}",
name: "`${adv_event.title}`",
name: {adv_event.title},
我打算删除帖子,但是,如果将来有其他人在寻找这个问题,]:
答案是
name: `${adv_event.title}`,