office-preview

1.1.8 • Public • Published

office-priview

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

支持格式:

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

注意事项:

  • 请确保提供正确的 URL,当链接无效时会提示:在您提供的 URL 中无法找到任何文档
  • WordPowerPoint 文档必须小于 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

Readme

Keywords

none

Package Sidebar

Install

npm i office-preview

Weekly Downloads

2

Version

1.1.8

License

MIT

Unpacked Size

134 kB

Total Files

15

Last publish

Collaborators

  • calvin_qi
  • hanyq