<!-- 二维码弹窗 -->
<template>
  <div>
    <el-dialog title="微信二维码登录" v-model="visible" width="30%" :close-on-click-modal="false" :close-on-press-escape="false" @before-close="close">
      <qrcode-vue :value="qrcode" :size="350" :margin="8" colorDark="#2c3e50" colorLight="#f8f9fa" errorCorrectionLevel="H" />
    </el-dialog>
  </div>
</template>
<script setup lang="ts">
  import QrcodeVue from 'qrcode.vue'
  const visible = defineModel('visible', {
    default: false,
  })
  const qrcode = defineModel('qrcode', {
    default: '',
  })

  const close = () => {
    visible.value = false
    qrcode.value = ''
  }
</script>

<style lang="scss" scoped>
  :deep(.el-dialog__body) {
    text-align: center !important;
  }
</style>
