npm install vue-qr --save
import vueQr from 'vue-qr'
<vue-qr :logoSrc="imageUrl" text="https://blog.csdn.net/weixin_42601136" :size="200"></vue-qr>
<script>
export default {
name: "qecode",
data() {
return {
imageUrl: require("../img/logo.png"),
}
},
components: {
vueQr
},
},
}
</script>
<script setup lang="ts">
import {reactive} from 'vue'
import VueQr from 'vue-qr/src/packages/vue-qr.vue'
const state=reactive({
hello:'xxxxx'
})
</script>
<template>
<div>
<vue-qr :logoSrc="imageUrl" :text="state.hello" :size="200"></vue-qr>
</div>
</template>
参考链接:blog.csdn.net/m0_48985355…