我正在使用这个react-select
:https://github.com/JedWatson/react-select
他们需要的选项数据格式为:
const options = [
{ value: 'chocolate', label: 'Chocolate' },
{ value: 'strawberry', label: 'Strawberry'},
{ value: 'vanilla', label: 'Vanilla' }
];
我的数组设置如下:
const columns = [
{ name: 'OrderNumber', title: 'Order Number' },
{ name: 'strawberry', title: 'Strawberry' },
{ name: 'vanilla', title: 'Vanilla' }
]
我无法更改我的数组。如果尝试在选项中使用name
或value
,那么使用select-react
时会遇到问题。如果将我的name
更改为value
,则选择选项正在填充,但我不想这样做。
有人可以教我如何将我的数组的name
更改为value
吗?
react-select
吗? - devserkan