vue-barcode: JsBarcode is not a function
Hi, I got an error of ‘JsBarcode is not a function’.
Here is my component:
<script setup lang="ts">
import VueBarcode from '@chenfengyuan/vue-barcode';
</script>
<template>
<vue-barcode value="5901234123457" :options="{ format: 'EAN13' }"></vue-barcode>
</template>
Browser shows these error messages:
And I installed JsBarcode for sure.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 15 (5 by maintainers)
Commits related to this issue
- fix: import jsbarcode directly to avoid errors fix #17, ref #14, #15 — committed to fengyuanchen/vue-barcode by fengyuanchen a year ago
This is still not working. I get the same error on Vue 3.
don’t works in vite TypeError: JsBarcode is not a function
I’m also facing the same error on Vue3.
How about registering the component as a global one? This works fine for me.