【发布时间】:2017-08-23 23:57:29
【问题描述】:
JSFiddle:https://jsfiddle.net/40vpaLj5/
我搜索了一些问题,发现唯一消失的相关问题是人们在模态框上使用它时,他们谈到设置 z-index 来修复它。反正我试了还是一无所获。我该如何解决这个问题?
import React from 'react';
import PlaylistPages from './PlaylistPages';
class PlaylistSortableComponent extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
test: [
'1','2', '3', '4'
]
}
}
render() {
return (
<PlaylistPages pages={this.state.test} style={{zIndex: 999999}} />
);
}
}
const PlaylistPages = SortableContainer(({pages}) => {
return (
<div>
{
pages.map((page, index) =>
<PlaylistPage key={index} page={page} style={{zIndex: 99999999}} />
)}
</div>
);
});
const PlaylistPage = SortableElement(({page}) => {
return (
<div style={{zIndex: 99999999}} >{page}</div>
);
});
【问题讨论】:
标签: javascript reactjs drag-and-drop higher-order-components react-sortable-hoc