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
3.93k stars 462 forks source link

Vite打包后,项目运行报错 #300

Open LazerChing opened 4 months ago

LazerChing commented 4 months ago

PixPin_2024-06-12_15-09-49 image

  1. 组件名称及版本:

    • "@vue-office/docx": "^1.6.2",
    • "@vue-office/excel": "^1.7.8"
  2. 运行环境:

    • 浏览器:Edge最新浏览器
    • vue版本:^3.4.21
    • 打包工具及版本:vite^5.2.0
  3. 详细依赖 "dependencies": { "@vue-office/docx": "^1.6.2", "@vue-office/excel": "^1.7.8" }, "devDependencies": { "@vitejs/plugin-vue": "^5.0.4", "sa-file-previewer": "^0.1.18", "typescript": "^5.2.2", "vite": "^5.2.0", "vite-plugin-dts": "^3.9.1", "vue": "^3.4.21", "vue-demi": "^0.14.8", "vue-tsc": "^2.0.6" },

TranscendArcher commented 2 months ago

我也遇到了,排查了一下,是组件不支持vue3.4;vue降到3.3就解决了

LazerChing commented 2 months ago

我也遇到了,排查了一下,是组件不支持vue3.4;vue降到3.3就解决了

我联系作者,改用纯js库解决了,用法一致

"dependencies": {
  "@js-preview/docx": "^1.6.2",
  "@js-preview/excel": "^1.7.8"
},