mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
774 B
27 lines
774 B
<script setup lang="ts"> |
|
import { useQRCode } from '@vueuse/integrations/useQRCode' |
|
|
|
const value = inject(CellValueInj) |
|
|
|
const qrValue = computed(() => String(value?.value)) |
|
const qrCode = useQRCode(qrValue, { |
|
width: 150, |
|
}) |
|
const qrCodeLarge = useQRCode(qrValue, { |
|
width: 600, |
|
}) |
|
|
|
const visible = ref<boolean>(false) |
|
const showQrModal = () => (visible.value = true) |
|
const handleOk = (e: MouseEvent) => { |
|
console.log(e) |
|
visible.value = false |
|
} |
|
</script> |
|
|
|
<template> |
|
<a-modal v-model:visible="visible" :title="qrValue" footer @ok="handleOk" :bodyStyle="{ padding: '0px' }"> |
|
<img v-if="qrValue" :src="qrCodeLarge" alt="QR Code" class="qr-code" /> |
|
</a-modal> |
|
<img v-if="qrValue" :src="qrCode" alt="QR Code" class="qr-code" @click="showQrModal" /> |
|
</template>
|
|
|