前端vue3项目实现.doc文档在手机端的预览
上周写个项目,里面有个功能是实现文档在手机上预览,大家知道文档在手机上一般是能直接下载,而不是展示的,因此摸索出了几个文档展示的方法
1链接拼接展示
<iframe src="https://view.officeapps.live.com/op/view.aspx?src=你的文档链接" allowfullscreen="true" frameborder="0" :height="height" width="100%" ></iframe>
2另一种链接拼接展示
<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=你的文档链接" sandbox="allow-scripts allow-forms allow-top-navigation" frameborder="0"></iframe>
3把文档转成html再展示
<iframe src="你的转换成html的文档地址"allowfullscreen="true"frameborder="0" :height="height" width="100%"></iframe>