在WordPress SelectControl中,如何将标签选项从已解析的json中取出,而不是为选项提供固定的标签和值?
e、 g.myjson={“A1”:“1”、“A2”、“2},其中A1是标签,1是值
<SelectControl
label="Asset id"
value={this.attributes.asset_id}
options=[{label: "Select one", value: null, disabled: true},
{label: "A1", value: "A1id"},
{label: "A2", value: "A2id"},
{label: "A3", value: "A3id"},
{label: "A4", value: "A4id"}]
onChange={(newval) => this.setAttributes({ asset_id: newval })}
/>