<template>
  <!-- 组件有问题 -->
  <el-dialog
    title="预览PDF文件"
    :visible="dialogVisible"
    @close="close"
    center
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    width="800px"
  >
    <!-- <canvas v-for="page in pages" :id="'the-canvas'+page" :key="page"></canvas> -->
    <div id="demo"></div>
    <template v-slot:footer>
      <div class="dialog-footer">
        <el-button type="primary" @click="close">确 定</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script>
import { $on, $off, $once, $emit } from '../../../../utils/gogocodeTransfer'
export default {
  data() {
    return {
      pdfh5: null,
    }
  },
  props: {
    dialogVisible: {
      type: Boolean,
      default: false,
    },
  },
  computed: {},
  components: {
    // PDF
  },
  mounted() {
    // //实例化
    // this.pdfh5 = new Pdfh5("#demo", {
    //   pdfurl: "http://10.177.11.169:9000/test.pdf"
    // });
    // //监听完成事件
    // this.pdfh5.on("complete", function(status, msg, time) {
    //   console.log(
    //     "状态：" +
    //       status +
    //       "，信息：" +
    //       msg +
    //       "，耗时：" +
    //       time +
    //       "毫秒，总页数：" +
    //       this.totalNum
    //   );
    // });
  },
  methods: {
    close() {
      $emit(this, 'close')
    },
  },
  emits: ['close'],
}
</script>

<style lang="scss" scoped>
/*// **/
 {
} /*// body,*/
// #app{}
</style>
