import react from 'react '
const App = () => {
const onmousedown = () => {
let isDown = false
isDown = true
window.onmouseup = () => {
isDown = false
window.onmousemove = null
}
window.onmousemove = (e: any) => {
if (isDown === false) {
return
}
;(document && document.getElementById('line')?.style?.left) ?? '0px'
const d: any = document.getElementsByClassName('ant-drawer-content-wrapper')[0]
const handle = document.body.clientWidth - e.clientX
if (handle > document.body.clientWidth) {
d.style.width = document.body.clientWidth + 'px'
return
}
d.style.width = handle + 'px'
}
}
return (
<Drawer title="查看详情" open={open} placement="right" onClose={onClose} width="800px">
<div id="line" onMouseDown={onmousedown} className="line"></div>
<UserMenu />
</Drawer>
)
}
export default APP
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35