关于组件更新时的样式改变? #12193
Unanswered
xiaofanghao
asked this question in
Help/Questions
关于组件更新时的样式改变?
#12193
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
这是组件的开头
这是修改逻辑
//鼠标移动
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