fix(视图): 提示框导致重绘

This commit is contained in:
wisonic-s 2024-01-02 17:46:37 +08:00
parent f55b633fc2
commit 617d543250

View File

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