PdfPreview.vue 1.01 KB
<template>
  <div>
    <a-modal
      :title="'PDF预览'"
      :width="800"
      :visible="batchVisible"
      :confirmLoading="confirmLoading"
      @ok="handleBatchCancel"
      @cancel="handleBatchCancel"
      cancelText="关闭"
      wrapClassName="ant-modal-cust-warp"
      style="top:5%;height: 85%;overflow-y: hidden">
    <iframe
      :id="id"
      :src="url"
      frameborder="0"
      width="100%"
      height="650px" >
    </iframe>
    </a-modal>
  </div>
</template>

<script>
  export default {
    name: "PdfPreviewModal",
    data () {
      return {
        batchVisible: false,
        confirmLoading: false,
        url: '',
        id:"pdfPreviewIframe",
        headers:{}
      }
    },
    created () {

    },
    computed:{

    },
    mounted(){

    },
    methods: {
      handleBatchCancel() {
        this.url = ''
        this.batchVisible = false
      },
      previewFiles (url) {
        this.url=url
        this.batchVisible=true
      },

    }
  }
</script>

<style scoped>

</style>