onDragEnd的正常响应是这样的。
{
'draggableId': '2',
'type': 'DEFAULT',
'source': {
'index': 0,
'droppableId': '1'
},
'mode': 'FLUID',
'destination': {
'droppableId': '2',
'index': 0
},
'combine': null,
'reason': 'DROP'
};
有什么方法可以将其他参数传递给可拖动组件,以便可以在onDragEnd中获取它们。
{
'draggableId': '2',
'type': 'DEFAULT',
'source': {
'index': 0,
'droppableId': '1'
},
'mode': 'FLUID',
'destination': {
'droppableId': '2',
'index': 0
},
'combine': null,
'reason': 'DROP'
data: {
cardSpecificKey : value
}
};
这将是有帮助的,这样,我不必再次读取状态即可获取那些必需的数据。