<!-- 预览文件 -->
<el-dialog :title="previewTitle" :visible.sync="previewDialog" width="50%" center class="dialog-preview"
@opened="opened" append-to-body>
<div class="dialog-content" :style="{height: previewHeight + 'px'}"></div>
<!-- <embed width="100%" :height="previewHeight" :src="fileUrl">-->
</el-dialog>
opened () {
if (this.fileUrl) {
let oldEmbed = document.querySelector("embed");
if(oldEmbed != null){
oldEmbed.parentNode.removeChild(oldEmbed)
}
let dialogBody = document.querySelector(".dialog-content")
let embed = document.createElement("embed")
embed.src = this.fileUrl
embed.style.width = "100%"
embed.style.height = "100%"
dialogBody.appendChild(embed)
}
},