1、pfile的文件预览
很简单一句话
window.open('http://www.pfile.com.cn/api/profile/onlinePreview?url='+encodeURIComponent(“文档地址”));
使用了一段时间,简单完美,强烈推荐!!!
2、 office online
let url = "https://view.officeapps.live.com/op/view.aspx?src=" + 文档url;
window.open(url); //新建窗口打开链接预览
或者
window.location.href = url; //本页面内跳转链接实现预览