mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 11:26:38 +00:00
adjust to PR comments
This commit is contained in:
@@ -5,9 +5,11 @@ const props = defineProps({
|
||||
barcodeValue: { type: String, required: true },
|
||||
barcodeFormat: { type: String, required: true },
|
||||
})
|
||||
|
||||
const emit = defineEmits(['onClickBarcode'])
|
||||
const barcodeSvgRef = ref(null)
|
||||
const errorForCurrentInput = ref(false)
|
||||
|
||||
const generate = () => {
|
||||
try {
|
||||
JsBarcode(barcodeSvgRef.value, String(props.barcodeValue), {
|
||||
@@ -31,12 +33,6 @@ onMounted(generate)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<svg data-testid="barcode" v-show="!errorForCurrentInput" ref="barcodeSvgRef" @click="onBarcodeClick"></svg>
|
||||
<svg class="w-full" data-testid="barcode" v-show="!errorForCurrentInput" ref="barcodeSvgRef" @click="onBarcodeClick"></svg>
|
||||
<slot v-if="errorForCurrentInput" name="barcodeRenderError" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
svg {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user