Vue 生成條形碼 jsbarcode的使用


安裝依賴包

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
    })


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM