我在我的Next.js项目中使用内容
我对内容丰富的文本有一个问题,当我添加一个新选项时,它将css类从我的第一个选项中删除,并且只应用第二个选项。不明白这是为什么。选项代码如下:
const options = {
renderNode: {
[BLOCKS.PARAGRAPH]: (node, children) => {
return (
<p className="text-primary">{children}</p>
)
}
},
renderNode: {
[BLOCKS.LIST_ITEM]: (node, children) => {
return (
<li className="text-sundown">{children}</li>
)
}
}};
发布于 2021-08-08 20:49:42
这是因为您不能在renderNode中拥有多个options属性。将段落和列表项css放在一个renderNode中。
const options = {
renderNode: {
[BLOCKS.PARAGRAPH]: (node, children) => {
return (
<p className="text-primary">{children}</p>
)
},
[BLOCKS.LIST_ITEM]: (node, children) => {
return (
<li className="text-sundown">{children}</li>
)
}
};https://stackoverflow.com/questions/68704576
复制相似问题