hulai-website/components/common/QRCodeBlock.vue
刘涛 a25f3a77ce sync: 同步最新呼籁官网代码到仓库
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 21:57:35 +08:00

55 行
977 B
Vue

<template>
<div class="qr-block" :class="[`qr-block--${size}`]">
<img :src="image" :alt="`${label}二维码`" class="qr-image" loading="lazy" />
<span class="qr-label">{{ label }}</span>
</div>
</template>
<script setup>
defineProps({
image: { type: String, required: true },
label: { type: String, required: true },
size: { type: String, default: 'normal' },
})
</script>
<style lang="less" scoped>
.qr-block {
display: flex;
flex-direction: column;
align-items: center;
gap: @space-xs;
}
.qr-image {
border-radius: @border-radius-sm;
background: @color-bg-gray;
object-fit: contain;
.qr-block--small & {
width: 80px;
height: 80px;
}
.qr-block--normal & {
width: 140px;
height: 140px;
}
.qr-block--large & {
width: 180px;
height: 180px;
}
}
.qr-label {
font-size: @font-size-xs;
color: @color-text-muted;
.qr-block--normal &,
.qr-block--large & {
font-size: @font-size-sm;
}
}
</style>