barcode: fix all the issues from PR review

This commit is contained in:
flisowna
2022-12-26 16:25:18 +01:00
parent 1ed99e8445
commit 9886e67ce3
5 changed files with 11 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts" setup>
import JsBarcode from 'jsbarcode'
import { onMounted } from '#imports'
const props = defineProps({
barcodeValue: { type: String, required: true },
@@ -7,6 +8,7 @@ const props = defineProps({
})
const emit = defineEmits(['onClickBarcode'])
const barcodeSvgRef = ref(null)
const errorForCurrentInput = ref(false)
@@ -27,8 +29,7 @@ const onBarcodeClick = (ev: MouseEvent) => {
emit('onClickBarcode')
}
watch(() => props.barcodeValue, generate)
watch(() => props.barcodeFormat, generate)
watch([() => props.barcodeValue, () => props.barcodeFormat], generate)
onMounted(generate)
</script>