wordToHtml(fileUrl){
console.log('我是在点击的时候实现的,打印fileUrl: ', fileUrl)
let vm=this;
const xhr = new XMLHttpRequest();
xhr.open("get", fileUrl, true);
xhr.responseType = "arraybuffer";
xhr.onload = function () {
if (xhr.status === 200) {
mammoth
.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) })
.then(function (resultObject) {
vm.$nextTick(() => {
vm.content=resultObject.value;
});
});
}
};
xhr.send();
},
word转html
最新推荐文章于 2023-04-23 15:51:05 发布