Merge pull request #7497 from dataease/pr@dev@fix_tooltip_redraw

fix(视图): 提示框导致重绘
This commit is contained in:
wisonic-s 2024-01-02 17:49:05 +08:00 committed by GitHub
commit 7b84970327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,7 +175,9 @@ export default {
outStyle: { outStyle: {
width: null, width: null,
height: null height: null
} },
resizeObserver: null,
resizerTimer: null
} }
}, },
computed: { computed: {
@ -239,18 +241,18 @@ export default {
created() { created() {
}, },
mounted() { mounted() {
const _this = this this.resizeObserver = new ResizeObserver(() => {
// div this.resizerTimer && clearTimeout(this.resizerTimer)
const erd = elementResizeDetectorMaker() this.resizerTimer = setTimeout(() => {
erd.listenTo(document.getElementById(this.canvasDomId), element => { this.$nextTick(this.restore)
_this.$nextTick(() => { }, 500)
_this.restore()
})
}) })
this.resizeObserver.observe(document.getElementById(this.canvasDomId))
}, },
beforeDestroy() { beforeDestroy() {
bus.$off('component-dialog-edit', this.editDialog) bus.$off('component-dialog-edit', this.editDialog)
bus.$off('button-dialog-edit', this.editButtonDialog) bus.$off('button-dialog-edit', this.editButtonDialog)
this.resizeObserver?.disconnect()
}, },
methods: { methods: {
getWrapperChildRefs() { getWrapperChildRefs() {