Files
frontend-app/components/qrcode-preview.vue
T
2026-07-25 09:12:36 +08:00

56 lines
1004 B
Vue

<template>
<up-popup :show="show" @close="close" @open="open" mode="center" :round="10">
<view class="qrcode-preview" @click.stop="close" v-if="qrcodeUrl">
<up-qrcode :val="qrcodeUrl" :key="key"></up-qrcode>
</view>
</up-popup>
</template>
<script>
export default {
props: {
qrcodeVal: {
type: String,
default: "",
},
},
data() {
return {
show: false,
qrcodeUrl: "",
key: 0,
};
},
methods: {
open() {
this.show = true;
this.$nextTick(() => {
this.qrcodeUrl = this.qrcodeVal;
this.key++;
console.log('qrcodeUrl',this.qrcodeUrl);
});
},
close() {
this.show = false;
this.qrcodeUrl = "";
},
},
};
</script>
<style lang="scss" scoped>
.qrcode-preview {
width: 440rpx;
height: 440rpx;
background: #ffffff;
border-radius: 8rpx;
// padding: 40rpx;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
}
</style>