直接npm:
pdf依赖:cnpm install --save vue-pdf
word依赖:cnpm install --save mammoth
excel依赖:cnpm install --save xlsx
参考:
vue word预览,excel预览,pdf预览_有问题可关注公众号:前端研究院 后台输入问题回复-CSDN博客_vue word 预览一、word预览–mammoth.js安装:npm install --save mammothtip:只能预览.docx文件word.vue: <template> <div> <div id="wordView" v-html="vHtml" /> </div></template><script>import mammoth from "mammoth";export default {https://wudan.blog.csdn.net/article/details/115349138vue实现预览word,excel,ppt,pdf、图片、视频解决方案_辉@_@的博客-CSDN博客_vue实现word在线预览vue实现预览word,excel,ppt,pdf、图片、视频解决方案第一种简单方法: <el-tooltip content="预览" placement="top"> <el-button type="warning" @click="coverUrl(scope.row)" icon="el-icon-document" circle></el-button> </el-tooltip>https://blog.csdn.net/weixin_44378416/article/details/119543832?spm=1001.2101.3001.6650.4&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4.opensearchhbase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4.opensearchhbase