perf: iframe预览,没有加载完成也显示
This commit is contained in:
parent
8d409a1140
commit
08c9a16899
@ -70,19 +70,13 @@ export default {
|
|||||||
this.services.push({label: service, value: this.url})
|
this.services.push({label: service, value: this.url})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
this.$nextTick(() => {
|
||||||
this.url = undefined
|
|
||||||
this.services = []
|
|
||||||
}
|
|
||||||
const iframe = this.$refs.iframeContent;
|
|
||||||
if (iframe.attachEvent) {
|
|
||||||
iframe.attachEvent('onload', () => {
|
|
||||||
this.onReady()
|
this.onReady()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
iframe.onload = () => {
|
this.url = undefined
|
||||||
this.onReady()
|
this.services = []
|
||||||
}
|
this.$emit('loadFileFailed')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
base64EncodeUnicode(str) {
|
base64EncodeUnicode(str) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user