1.0.0 • Published 3 years ago

al-document-viewer3 v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

base-document-viewer

install

  npm install al-document-viewer

use

<template>
  <div>
    <al-document-viewer 
      :fileSrc="fileSrc" 
      :fileType="fileType" 
      :visible.sync="visible" // visible 是否可以展示
    />
    <button @click="toClick">点击</button>
  </div>
</template>

<script>
import AlDocumentViewer from 'al-document-viewer'
export default {
  data(){
    return {
      fileSrc:[ // fileSrc 文件路径
        'http://zy-zymreal-source-test.oss-cn-shanghai.aliyuncs.com/0029e2198d651ed492d5e39a0939538dc2c63526.pdf',
        'http://zy-zymreal-source-test.oss-cn-shanghai.aliyuncs.com/0135f18aaa5e43918090d9797e30c4ed.pdf'
      ],
      visible: false, 
      fileType: 'pdf', // fileType 文件类型 1. 'img' 图片 2. 'office' 文档 3. 'pdf' pdf 
    }
  },
  components:{
    AlDocumentViewer
  },
  methods:{
    toClick(){
      this.visible = true
    }
  }
}
</script>
1.0.0

3 years ago