mirror of
https://github.com/blossom-editor/blossom
synced 2024-11-17 22:48:03 +08:00
优化编辑器与预览之间的拖动条
This commit is contained in:
parent
8ff0f213bd
commit
0d76d6798d
@ -18,6 +18,9 @@ export const useResize = (
|
||||
// editor 距离应用左侧的距离
|
||||
const targetLeft = targetRect.left
|
||||
|
||||
resizeDividerRef.value!.style.borderLeft = '2px dashed var(--el-color-primary)'
|
||||
document.body.style.cursor = 'ew-resize'
|
||||
|
||||
const onMousemove = (e: MouseEvent) => {
|
||||
const x = Math.max(0, e.clientX - targetLeft)
|
||||
editorRef.value!.style.width = `${x}px`
|
||||
@ -25,6 +28,8 @@ export const useResize = (
|
||||
}
|
||||
|
||||
const onMouseup = () => {
|
||||
document.body.style.cursor = 'auto'
|
||||
resizeDividerRef.value!.style.borderLeft = '2px solid var(--el-border-color)'
|
||||
document.removeEventListener('mousemove', onMousemove)
|
||||
document.removeEventListener('mouseup', onMouseup)
|
||||
}
|
||||
|
@ -103,11 +103,11 @@
|
||||
height: 100%;
|
||||
border-left: 2px solid var(--el-border-color);
|
||||
margin-left: 1px;
|
||||
cursor: ew-resize;
|
||||
z-index: 3;
|
||||
cursor: ew-resize;
|
||||
|
||||
&:hover {
|
||||
border-left: 2px dashed var(--el-color-primary);
|
||||
border-left: 2px dashed var(--el-color-primary) !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user