<template>
  <el-dialog
    title="二维码"
    v-if="dialog.qrcode"
    custom-class="custom-dialog"
    :visible.sync="dialog.qrcode"
    width="500px"
  >
    <div>
      <div id="qrcode">
        <img
          style="width:200px;height:200px;margin:auto;display:block;"
          :src="'/image-service/common/file_get/'+ qrcodeUrl +'?systemId=dataPlatform'"
          alt="二维码"
        >
      </div>
    </div>
  </el-dialog>
</template>
<script>
// import { qrcanvas } from "qrcanvas";
export default {
  props: {
    dialog: {
      type: Object,
      default: function () {
        return {
          qrcode: false
        };
      }
    },
    qrcodeUrl: {
      default: ""
    }
  },
  data() {
    return {};
  },
  created() { },
  mounted() {
  },
  methods: {
    // getCanvas(id) {
    //     let canvas = qrcanvas({
    //         cellSize: 8,
    //         data: 'http://service.sagacloud.cn/qrcode/' + 'Pea3a31168a30d4056acda3a56e557940b'
    //     });
    //     canvas.style.margin = "auto"
    //     canvas.style.display = "block"
    //     this.$nextTick(() => {
    //         document.getElementById("qrcode").innerHTML = null;
    //         document.getElementById("qrcode").appendChild(canvas);
    //     });
    // }
  }
};
</script>
<style lang="less" scoped>
#qrcode {
    height: 300px;
    overflow: auto;
}
</style>
