diff --git a/src/components/pivot/index.vue b/src/components/pivot/index.vue index 4a390d9..4ee08b6 100644 --- a/src/components/pivot/index.vue +++ b/src/components/pivot/index.vue @@ -3,8 +3,10 @@
{ diff --git a/src/components/pivot/moving-pivot.vue b/src/components/pivot/moving-pivot.vue index eae3e78..ab87bfd 100644 --- a/src/components/pivot/moving-pivot.vue +++ b/src/components/pivot/moving-pivot.vue @@ -73,8 +73,6 @@ function onMousemove(event) { // 此时距离用户信标比较近,隐藏主信标 MovingPivot.show = false; MovingPivot.currentTakenPivot = userPivot; - } else { - MovingPivot.show = true; } } } diff --git a/src/components/pivot/user-pivot.vue b/src/components/pivot/user-pivot.vue index b3b69a8..ac0f9b0 100644 --- a/src/components/pivot/user-pivot.vue +++ b/src/components/pivot/user-pivot.vue @@ -3,7 +3,6 @@ v-if="renderPivot" @mouseenter="onEnter()" @mouseleave="onLeave()" - @mouseup="onVLineMouseup()" @contextmenu.prevent="handleUserContextMenu($event)" class="user-pivot" > @@ -20,7 +19,6 @@ :style="colorStyle" :ref="el => vline.element = el" @mousedown.stop="onVLineMousedown()" - @mouseup.stop="onVLineMouseup()" >
{{ props.label }}
@@ -127,7 +125,8 @@ function onLeave() { const vline = reactive({ dragEnable: false, element: undefined, - originTime: 0 + originTime: 0, + delayTag: false, }); @@ -156,6 +155,11 @@ function onVLineMousedown() { // console.log('begin to drag'); mousemoveEventPipes.set(pivot.id, event => { + if (vline.dragEnable === false || vline.delayTag === true) { + return; + } + console.log('move pivot', vline); + const x = event.clientX || event.x; pivot.x = x; const pstate = globalLookup.pstate; @@ -168,6 +172,16 @@ function onVLineMousedown() { }); } +document.onmouseup = () => { + vline.delayTag = true; + console.log('mouse up'); + console.log(vline); + setTimeout(() => { + vline.delayTag = false; + }, 300); + onVLineMouseup(); +} + function onVLineMouseup() { MovingPivot.dragEnable = false; mousemoveEventPipes.delete(props.id); diff --git a/src/components/toolbar/index.vue b/src/components/toolbar/index.vue index 847fa5e..0146340 100644 --- a/src/components/toolbar/index.vue +++ b/src/components/toolbar/index.vue @@ -1,5 +1,8 @@