微信支付

发布时间 2023-07-03 16:30:54作者: zjxgdq
import React, { useState } from 'react'
import QRCode from 'qrcode'
export default function ceshi() {

const [image,setImage] =useState();
const handleget =async ()=>{
  const landingPageUrl = 'weixin:。。。。。。';    
  const qrcodeUrl = await QRCode.toDataURL(landingPageUrl);
  setImage(qrcodeUrl)
}
  return (
    <div>
      <img style={{width:"200px",height:"200px"}} src={image} alt="" />
      <button onClick={handleget}>点击</button>
    </div>
  )
}