普通视图

发现新文章,点击刷新页面。
今天 — 2026年1月21日首页

关于 vue-office 第三方使用踩坑小计

作者 心源xinyuan
2026年1月21日 14:17

vue-office 这个库适用于vue项目里面查看相应文档展示的一个组件,具体使用: vue-office

1.导入报错

官方文档:

image.png

我的使用:

image.png

这里报错!!!

后面改成在main.ts中配置 解决。。。(具体问题没找到,有人遇到类似的吗,是啥原因,版本问题?) image.png

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)
    }
❌
❌