安裝依賴包
npm install jsbarcode --save 😄
在使用頁面引入依賴包
import JsBarcode from 'jsbarcode'
定義img標簽和id
<img id="barcode" />
在使用頁面開始生成,可以寫在方法中或者mounted中
JsBarcode('#barcode', 'DY2020080400088', {
format: 'CODE39',
lineColor: '#000',
background: '#EBEEF5',
width: 2,
height: 40,
displayValue: false
})