mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
upd: update resize of drawio
This commit is contained in:
@@ -54,10 +54,10 @@ const Drawio = defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
const timer = setTimeout(resize, 1000)
|
||||
let timer: any
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
clearTimeout(timer)
|
||||
timer && clearTimeout(timer)
|
||||
})
|
||||
|
||||
const button = (text: string, onClick: any) => h('button', {
|
||||
@@ -128,7 +128,10 @@ const Drawio = defineComponent({
|
||||
h(IFrame, {
|
||||
html: srcdoc.value,
|
||||
ref: refIFrame,
|
||||
onLoad: resize,
|
||||
onLoad: () => {
|
||||
resize()
|
||||
timer = setTimeout(resize, 1000)
|
||||
},
|
||||
iframeProps: {
|
||||
class: 'drawio',
|
||||
height: '300px',
|
||||
|
||||
Reference in New Issue
Block a user