有人可以在这里解释我的错吗......
<Something
content={[
{
heading: "Add Company",
icon: "plus",
options: {[
{
image: "srcimage",
text: "New Company",
link: "test"
}, { //Errors here
image: "srcimage",
text: "Existing Company",
link: "test"
}
]}
}, {
heading: "Import Company",
icon: "download",
options: {[
{
image: "/src/image",
text: "Class",
link: "/test"
},
{
image: "/src/image",
text: "BGL",
link: "/test"
},
{
image: "/src/image",
text: "SuperMate",
link: "/test"
}
]}
}]
} />
我收到错误消息Unexpected token, expected "]"
,上面写着error here
。最终,我想根据这样传递的内容来创建一些内容块...。
谢谢
答案 0 :(得分:2)
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
#tabbrowser-tabs .tabbrowser-tab .tab-close-button { display:none!important; }
是对象的无效语法。
{[]}
答案 1 :(得分:0)
对于options属性,您需要删除花括号,只需传递数组
options: [
{
image: "srcimage",
text: "New Company",
link: "test"
},
{
image: "srcimage",
text: "Existing Company",
link: "test"
}
]