doc:获取二进制文件示例

This commit is contained in:
liyulin 2023-08-27 22:09:49 +08:00
parent f7b62649ef
commit 2cd4e0aa16

View File

@ -131,17 +131,17 @@ export default {
return { return {
docx: '' docx: ''
} }
}, },
mounted(){ mounted(){
fetch('你的API文件地址', { fetch('你的API文件地址', {
method: 'post' method: 'post'
}).then(res=>{ }).then(res=>{
//读取文件的arrayBuffer //读取文件的arrayBuffer
res.arrayBuffer().then(res=>{ res.arrayBuffer().then(res=>{
this.src = res this.docx = res
})
}) })
}, })
},
methods:{ methods:{
rendered(){ rendered(){
console.log("渲染完成") console.log("渲染完成")