improve demo resizing
This commit is contained in:
committed by
Hans Pagel
parent
6fb953dab8
commit
138cd75b3c
@@ -23,6 +23,26 @@ export default {
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
resizeObserver: null,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.resizeObserver = new window.ResizeObserver(() => {
|
||||
if (window.parentIFrame) {
|
||||
window.parentIFrame.sendMessage('resize')
|
||||
}
|
||||
})
|
||||
|
||||
this.resizeObserver.observe(document.body)
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.resizeObserver.unobserve(document.body)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user