<template>
  <div>
    <img :id="'barcode' + index" style="max-width: 100%" />
  </div>
</template>

<script setup>
import JsBarcode from "jsbarcode";
const props = defineProps({
  value: {
    type: String,
    default: "",
  },
  index: {
    type: Number,
  },
});
onMounted(() => {
  JsBarcode("#barcode" + props.index, String(props.value), {
    format: "CODE128",
    lineColor: "#000",
    background: "white",
    width: 1.6,
    height: 50,
    displayValue: true,
  });
});
</script>
