You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
这是组件的开头
这是修改逻辑
//鼠标移动
const onMouseMove = (e: MouseEvent) => {
if (!moveStatus || !dragContainer.value || !dragStyle) return;
let boxWidth = parseFloat(dragStyle.width)
let boxHeight = parseFloat(dragStyle.height)
const newLeft = Math.min(window.innerWidth - boxWidthscreenStore.screenScale, Math.max(0, e.clientX - offsetX));
const newTop = Math.min(window.innerHeight - boxHeightscreenStore.screenScale, Math.max(0, e.clientY - offsetY));
dragContainer.value.style.left =
${(e.clientX-offsetX*screenStore.screenScale)}px
;//相当于鼠标水平位置左移鼠标在弹窗的位置dragContainer.value.style.top =
${(e.clientY-offsetY*screenStore.screenScale)}px
;//跟上面类似}
请问在组件更新时以哪个为准?
我想以拖拽后的结果为准如何修改?
Beta Was this translation helpful? Give feedback.
All reactions