react拖拽改变某一块div的宽高

拖动改变某一块div的宽高

{ DetailStore.dragable = true; DetailStore.oldY = e.pageY; DetailStore.midHeight = document.getElementById('dataSetTable').clientHeight; document.onmousemove = event => { if (DetailStore.dragable && DetailStore.midHeight !== 0) { let y = DetailStore.oldY - event.pageY + DetailStore.midHeight; if (y > 50) { DetailStore.endHeight = y + 'px'; } else { DetailStore.endHeight = 50 + 'px'; } y = null; } }; document.onmouseup = () => { if (DetailStore.dragable) { DetailStore.midHeight = DetailStore.endHeight; } DetailStore.oldY = 0; DetailStore.dragable = false; }; }} >

你可能感兴趣的:(react拖拽改变某一块div的宽高)