501351981 / vue-office

支持word(.docx)、excel(.xlsx,.xls)、pdf、pptx等各类型office文件预览的vue组件集合,提供一站式office文件预览方案,支持vue2和3,也支持React等非Vue框架。Web-based pdf, excel, word, pptx preview library
https://501351981.github.io/vue-office/examples/docs/
MIT License
4.08k stars 471 forks source link

文件加载成功,但无法正常显示 #368

Closed zheyuanAI closed 1 month ago

zheyuanAI commented 1 month ago
"@vue-office/docx": "^1.6.2",
"@vue-office/excel": "^1.7.11",
"@vue-office/pdf": "^2.0.2",

"vue": "^3.2.45",
"vuex": "^4.1.0",

"vite": "^3.2.5",

现象:
    文件无法正常显示;
    在未屏蔽vue-office-docx、vue-office-pdf时,㢦和edge都无法正常显示(报错均为下述谷歌报错)
    屏蔽后,谷歌不可以,edge可以正常显示

报错:Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function. 
以及 Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function. 

具体代码:
    <!--    <vue-office-docx v-if="show1" @error="errorHandler" :src="pdfUrl"/>-->
    <!--    <vue-office-pdf v-if="show2" :src="pdfUrl"/>-->
            <vue-office-excel  v-if="show4"  @error="errorHandler" :src="pdfUrl"/>