26 lines
439 B
Vue
26 lines
439 B
Vue
<script setup>
|
|
import JsBarcode from "jsbarcode";
|
|
|
|
const props = defineProps({
|
|
imei: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
});
|
|
|
|
const barcodeSvg = useTemplateRef("barcode");
|
|
onMounted(() => {
|
|
if (barcodeSvg.value)
|
|
JsBarcode(barcodeSvg.value, props.imei, {
|
|
background: "transparent",
|
|
width: 1,
|
|
height: 15,
|
|
displayValue: false,
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<svg ref="barcode"></svg>
|
|
</template>
|