fix:修复出现滚动条,样式组件位置定位不准确问题

This commit is contained in:
wangjiahao 2021-09-22 18:34:02 +08:00
parent 5e1a37794e
commit 3ca7a5e029
2 changed files with 6 additions and 2 deletions

View File

@ -11,6 +11,7 @@
:style="customStyle" :style="customStyle"
@dragover="handleDragOver" @dragover="handleDragOver"
@mousedown="handleMouseDown" @mousedown="handleMouseDown"
@scroll="canvasScroll"
> >
<!-- 网格线 --> <!-- 网格线 -->
<!-- <Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" />--> <!-- <Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" />-->
@ -666,6 +667,9 @@ export default {
} else { } else {
return y return y
} }
},
canvasScroll(event) {
this.$emit('canvasScroll', event)
} }
} }
} }

View File

@ -100,9 +100,8 @@
@drop="handleDrop" @drop="handleDrop"
@mousedown="handleMouseDown" @mousedown="handleMouseDown"
@mouseup="deselectCurComponent" @mouseup="deselectCurComponent"
@scroll="canvasScroll"
> >
<Editor v-if="!previewVisible" :out-style="outStyle" /> <Editor v-if="!previewVisible" :out-style="outStyle" @canvasScroll="canvasScroll" />
</div> </div>
</de-main-container> </de-main-container>
<!-- <de-aside-container v-if="aidedButtonActive" :class="aidedButtonActive ? 'show' : 'hidden'" class="style-aside">--> <!-- <de-aside-container v-if="aidedButtonActive" :class="aidedButtonActive ? 'show' : 'hidden'" class="style-aside">-->
@ -696,6 +695,7 @@ export default {
} }
}, },
canvasScroll(event) { canvasScroll(event) {
console.log('testTop' + event.target.scrollTop)
this.scrollLeft = event.target.scrollLeft this.scrollLeft = event.target.scrollLeft
this.scrollTop = event.target.scrollTop this.scrollTop = event.target.scrollTop
}, },