如图:
首先 下载好qrcode.vue
npm install qrcode -S
QRCode.js 是一个用于生成二维码的 JavaScript 库。
主要是通过获取 DOM 的标签,再通过 HTML5 Canvas 绘制而成,不依赖任何库。
go!
准备好一个button 我这里用的是antd-disign-vue 的button 加好点击事件 和 modal的开关
<a-button type="primary" @click="showModalQrCode = true"> 生成二维码 </a-button>
接下来用到antd-design-vue里的modal
<a-modal v-model:visible="showModalQrCode" :footer="null" :body-style="{ marginLeft: '17%' }" :centered="true" :width="270" :height="326">
<template #title&g