关于 vue-office 第三方使用踩坑小计
2026年1月21日 14:17
vue-office 这个库适用于vue项目里面查看相应文档展示的一个组件,具体使用: vue-office
1.导入报错
官方文档:
![]()
我的使用:
![]()
这里报错!!!
后面改成在main.ts中配置 解决。。。(具体问题没找到,有人遇到类似的吗,是啥原因,版本问题?)
![]()
2.PPT使用
这个文档里面没有具体说明导入,但是demo里有
npm install @vue-office/pptx vue-demi //安装
//使用
import VueOfficePptx from '@vue-office/pptx'
<vue-office-pptx
:src="pptxUrl"
style="height: 80vh"
@rendered="handleRendered"
@error="handleError" />
pptxUrl: 'https://501351981.github.io/vue-office/examples/dist/static/test-files/test.pptx'
handleRendered() {
console.log('PPTX渲染完成')
}, handleError(error)
{
console.error('渲染失败:', error)
}