2 回答

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超9個(gè)贊
您是說要顯示選項(xiàng)和價(jià)值嗎?
const filters = [
{
label: "name",
options: [
{ value: "Dietrich", label: "Dietrich" },
{ value: "Patricia", label: "Patricia" }
]
},
{
label: "username",
options: [
{ value: "Kamren", label: "Kamren" },
{ value: "Bret", label: "Bret" }
]
},
{
label: "email",
options: [{ value: "Sincere@april.biz", label: "Sincere@april.biz" }]
}
];
function App() {
return (
<section>
{filters.map(data => {
const label = <label> {data.label} </label>
return (
<section>
{label}
<select>
{data.options.map(option => {
return(
<option value={option.value}> {option.value} </option>
)
})}
</select>
</section>
)
})}
</section>
)
}

TA貢獻(xiàn)1813條經(jīng)驗(yàn) 獲得超2個(gè)贊
從其他文件導(dǎo)入它們:
import { usersRowData as filters } from "./otherFile";
添加回答
舉報(bào)