使用 TypeScript
基于 awesome-qr.js 与 Vue3
开发的二维码组件。支持丰富的配置属性,并且支持:LOGO 、BackgroundImage 、GIF 等。简单配置,即可使用漂亮好看的二维码~
npm i vue3-next-qrcode
<script lang="ts" setup> import { Vue3NextQrcode } from 'vue3-next-qrcode' </script> <template> 基础二维码 <Vue3NextQrcode text="hello" /> LOGO 二维码 <Vue3NextQrcode text="hello" logoImage="your logo image" /> BackgroundImage 二维码 <Vue3NextQrcode text="hello" backgroundImage="your logo image" /> </template>
注意:使用 GIF URL
的时候,应该使用 gifBackgroundURL
属性。
<script lang="ts" setup> import { Vue3NextQrcode } from 'vue3-next-qrcode' </script> <template> GIF URL <Vue3NextQrcode text="hello" gifBackgroundURL="your gif url" /> GIF ArrayBuffer <Vue3NextQrcode text="hello" gifBackground="your gif ArrayBuffer" /> </template>
如果觉得该项目对你有帮助,可以点一个小星星,或者提出你的宝贵意见~