Qrcode 二维码

February 27, 2026 · View on GitHub

二维码生成组件。

引入

import { AQrcode } from '@airpower/web'

Props

参数说明类型默认值必填
content二维码内容string-
size二维码尺寸number200

Emits

Slots

示例

<template>
  <!-- 基础用法 -->
  <AQrcode content="https://example.com" />

  <!-- 自定义尺寸 -->
  <AQrcode 
    content="https://example.com"
    :size="300"
  />

  <!-- 动态内容 -->
  <AQrcode 
    :content="qrContent"
    :size="256"
  />
</template>

<script setup lang="ts">
const qrContent = ref('https://example.com')
</script>

注意事项

  • 二维码内容变化时会自动重新生成
  • 支持二维码容错率 H(最高)
  • 组件有白色背景和圆角边框
  • 内容为空时显示 Loading 状态