<template>
  <el-dialog :title="title" :visible.sync="visible" v-dialogDrag :close-on-click-modal="false" :before-close="cancel"
    fullscreen>
    <div class="dia-box">
      <iframe style="text-align:center" noresize align=center width="100%" :height="heightStatus" :src="pdfUrl"
        frameborder="0" scrolling="no"></iframe>
      <div style="display: none;text-align:right;margin:15px 0 20px;">
        <el-button size="mini" @click="cancel">关闭</el-button>
      </div>
    </div>
  </el-dialog>
</template>
<script>
  export default {
    name: 'DiaPdf',
    props: {
      visible: {
        type: Boolean,
        default: () => false
      },
      pdfUrl: {
        type: String,
        default: () => ''
      },
      title: {
        type: String,
        default: () => '打印'
      }
    },
    data() {
      return {
        heightStatus: window.innerHeight
      };
    },
    methods: {
      cancel() {
        this.$emit("cancel");
      },
    }
  };

</script>
