我以前曾设法放置和检索数据,但对于下面的功能菜单和下拉...the图像

那么,问题是如何在级联中检索或放置数据?我从蚂蚁设计示例中获取数据...我对如何从API中检索数据感到困惑...

我不知道如何在设计https://ant.design/components/cascader/中将数据从API放到级联程序中。
我直接使用codesanbox.io这个url https://codesandbox.io/embed/distracted-hodgkin-8lmt6分享代码。
发布于 2019-06-17 04:01:39
将allCategory id prop映射到value,将name映射到label prop:
render() {
const options = this.state.allCategory.map(category => ({
value: category.id,
label: category.name
}));
return <Cascader options={options} />;
}演示:
https://stackoverflow.com/questions/56619059
复制相似问题