html
<template>
<div style="display: flex; align-items: center; flex-direction: column">
<div style="width: 220px; height: 220px; background-color: #cccccc">
<div id="root" ref="qrCodeUrl"></div>
</div>
</div>
</template>
<script>
import QRCode from 'qrcodejs2'
export default {
props: {
fp_Object: Object
},
data() {
return {
qrcode: null
}
},
created() {
this.$nextTick(() => {
this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
text: '带http的url', // 需要转换为二维码的内容
width: 220,
height: 220,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
})
})
},
}
</script>
<template>
<div style="display: flex; align-items: center; flex-direction: column">
<div style="width: 220px; height: 220px; background-color: #cccccc">
<div id="root" ref="qrCodeUrl"></div>
</div>
</div>
</template>
<script>
import QRCode from 'qrcodejs2'
export default {
props: {
fp_Object: Object
},
data() {
return {
qrcode: null
}
},
created() {
this.$nextTick(() => {
this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
text: '带http的url', // 需要转换为二维码的内容
width: 220,
height: 220,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H
})
})
},
}
</script>