perf: iframe预览,没有加载完成也显示

This commit is contained in:
jmal 2024-06-22 19:08:16 +08:00
parent 8d409a1140
commit 08c9a16899

View File

@ -70,19 +70,13 @@ export default {
this.services.push({label: service, value: this.url})
}
}
} else {
this.url = undefined
this.services = []
}
const iframe = this.$refs.iframeContent;
if (iframe.attachEvent) {
iframe.attachEvent('onload', () => {
this.$nextTick(() => {
this.onReady()
})
} else {
iframe.onload = () => {
this.onReady()
}
this.url = undefined
this.services = []
this.$emit('loadFileFailed')
}
},
base64EncodeUnicode(str) {