feat: 更新上下文菜单拖拽功能,重命名位置变量以提高代码可读性

This commit is contained in:
xudan 2025-09-23 18:33:46 +08:00
parent aa568b2da4
commit 990b0ee4b4

View File

@ -69,7 +69,11 @@ const emit = defineEmits<Emits>();
const menuRef = ref<HTMLElement | null>(null);
const handleRef = ref<HTMLElement | null>(null);
const { x, y, style } = useDraggable(menuRef, {
const {
x: positionX,
y: positionY,
style,
} = useDraggable(menuRef, {
handle: handleRef,
});
@ -77,8 +81,8 @@ watch(
() => props.visible,
(isVisible) => {
if (isVisible) {
x.value = props.x;
y.value = props.y;
positionX.value = props.x;
positionY.value = props.y;
}
},
);