office-preview

office文档在线预览插件
1,022
Install
npm install office-preview
Latest Version:1.1.8
Vue:2
License:MIT
Last Updated:Aug 21, 2020
Links: npm
Maintainer: calvin_qi

office-priview

该插件提供office文档或图片的在线预览功能

支持格式:

  • Word: docx,dotx
  • Excel: xlsx,xlsb,xls,xlsm
  • PowerPoint: pptx,ppsx,ppt,pps,potx,ppsm

注意事项:

  • 请确保提供正确的 URL,当链接无效时会提示:在您提供的 URL 中无法找到任何文档
  • Word 和 PowerPoint 文档必须小于 10M,Excel 必须小于 5M

基本命令

# 安装依赖
npm install

# 本地测试localhost:8080
npm run dev

# 打包文件
npm run build

如何使用

<template>
  <div>
    <button @click="showFile">显示文档</button>
    <OfficePreview :fileUrl="fileUrl" v-if="show" :show.sync="show" />
  </div>
</template>

<script>
import OfficePreview from "./components/Main";

export default {
  data() {
    return {
      fileUrl: 'http://site.com/doc/path',
      show: false,
    };
  },
  components: {
    OfficePreview,
  },
  methods: {
    showFile() {
      this.show = !this.show;
    }
  }
};
</script>

如有问题请发送邮件至 282730228@qq.com

Version History

Version Released Vue License
1.1.8 ^2.5.11 MIT
1.1.7 ^2.5.11 MIT
1.1.6 ^2.5.11 MIT
1.1.5 ^2.5.11 MIT
1.1.4 ^2.5.11 MIT