<script setup>
const props = defineProps({
  image: { type: String, default: '' },
  label: { type: String, default: '二维码占位' },
  small: { type: Boolean, default: false }
})
</script>

<template>
  <div class="qr-wrap" :class="{ 'qr-wrap--small': small }" role="img" :aria-label="props.label">
    <img v-if="image" class="qr-image" :src="image" :alt="props.label" />
    <div v-else class="qr-fake">
      <span class="qr-corner tl"></span>
      <span class="qr-corner tr"></span>
      <span class="qr-corner bl"></span>
    </div>
    <p v-if="label" class="qr-label">{{ label }}</p>
  </div>
</template>
