Browse Source

qrcode: prevent default handling for cell click

* show only the bigger qr code in the modal
* and don't show the usual detail edit form
pull/4142/head
Daniel Spaude 2 years ago
parent
commit
ea97c6ffca
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 12
      packages/nc-gui/components/virtual-cell/QrCode.vue

12
packages/nc-gui/components/virtual-cell/QrCode.vue

@ -11,13 +11,17 @@ const qrCodeLarge = useQRCode(qrValue, {
width: 600, width: 600,
}) })
const visible = ref<boolean>(false) const modalVisible = ref<boolean>(false)
const showQrModal = () => (visible.value = true) const showQrModal = (ev: Event) => {
const handleOk = (e: MouseEvent) => (visible.value = false) ev.stopPropagation()
modalVisible.value = true
}
const handleModalOkClick = () => (modalVisible.value = false)
</script> </script>
<template> <template>
<a-modal v-model:visible="visible" :title="qrValue" footer @ok="handleOk" :bodyStyle="{ padding: '0px' }"> <a-modal v-model:visible="modalVisible" :title="qrValue" footer @ok="handleModalOkClick" :bodyStyle="{ padding: '0px' }">
<img v-if="qrValue" :src="qrCodeLarge" alt="QR Code" class="qr-code" /> <img v-if="qrValue" :src="qrCodeLarge" alt="QR Code" class="qr-code" />
</a-modal> </a-modal>
<img v-if="qrValue" :src="qrCode" alt="QR Code" class="qr-code" @click="showQrModal" /> <img v-if="qrValue" :src="qrCode" alt="QR Code" class="qr-code" @click="showQrModal" />

Loading…
Cancel
Save