pdf预览 iframe src赋值
word预览
1,http://view.officeapps.live.com/op/view.aspx?src=‘公网地址’
2.word转pdf
1:
<el-dialog
title="预览文件"
:visible="viewFileDialogVisible"
fullscreen
:before-close="handleClose"
>
<div>
<iframe ref="fileViewIframe" style="width: 100%; height:800px; border: 5px solid #80808021;" src="">
</iframe>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="viewFileDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="viewFileDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
console.log(row.xx.indexOf('.pdf'))
if (row.xx.indexOf('.pdf') != -1){
this.$refs.fileViewIframe.src = this.GLOBAL.host+ ''+ encodeURI(row.xx)
}else if (row.xx.indexOf('.doc') || row.zbwjurl.indexOf('.docx')){
this.$refs.fileViewIframe.src = 'https://view.officeapps.live.com/op/view.aspx?src=' + this.GLOBAL.host+ encodeURI(row.xx)
}