app/pages/mine/share.vue
2025-05-23 18:56:25 +08:00

43 lines
875 B
Vue

<template>
<view class="container">
<!-- 用于显示二维码的容器 -->
<view id="qrcode"></view>
</view>
</template>
<script>
import QRCode from 'qrcodejs2';
import config from "@/config/config.js";
export default {
data() {
return {
// ... existing code ...
};
},
onReady() {
this.generateQRCode();
},
methods: {
generateQRCode() {
if (config.downloadLink) {
new QRCode(document.getElementById('qrcode'), {
text: config.downloadLink,
width: 200,
height: 200,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
}
}
}
};
</script>
<style scoped>
#qrcode {
margin: 20px auto;
text-align: center;
}
</style>