Browse Source

barcode: fix barcode value in cleaner way

pull/4641/head
flisowna 2 years ago
parent
commit
94bbacf975
  1. 2
      packages/nc-gui/components/virtual-cell/QrCode.vue
  2. 3
      packages/nc-gui/components/virtual-cell/barcode/Barcode.vue

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

@ -6,7 +6,9 @@ const maxNumberOfAllowedCharsForQrValue = 2000
const cellValue = inject(CellValueInj)
const qrValue = computed(() => String(cellValue?.value))
const tooManyCharsForQrCode = computed(() => qrValue?.value.length > maxNumberOfAllowedCharsForQrValue)
const showQrCode = computed(() => qrValue?.value?.length > 0 && !tooManyCharsForQrCode.value)
const qrCode = useQRCode(qrValue, {

3
packages/nc-gui/components/virtual-cell/barcode/Barcode.vue

@ -40,8 +40,7 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning } = us
:footer="null"
@ok="handleModalOkClick"
>
<JsBarcodeWrapper v-if="showBarcode" :barcode-value="barcodeValue" :barcode-format="barcodeMeta.barcodeFormat">
</JsBarcodeWrapper>
<JsBarcodeWrapper v-if="showBarcode" :barcode-value="barcodeValue" :barcode-format="barcodeMeta.barcodeFormat" />
</a-modal>
<JsBarcodeWrapper
v-if="showBarcode"

Loading…
Cancel
Save