1、创建文件工具文件
2、导入使用
<template>
<view class="content">
<image :src="img" mode="aspectFill"></image>
</view>
</template>
<script>
import QR from "@/libs/wxqrcode.js"
export default {
data() {
return {
img: '',
}
},
onLoad() {
this.getImage('43r4regttygf')
},
methods: {
getImage(sn) {
this.img = QR.createQrCodeImg(sn, {})
},
}
}
</script>