1.npm install jsbarcode --save
2.<svg id="barcode" ref="barcode"></svg>
3.import JsBarcode from 'jsbarcode'
4.
let barCode = this.obj[0].label; this.$nextTick(()=>{ JsBarcode("#barcode", barCode, { format: "CODE128",//选择要使用的条形码类型 text: barCode, //显示文本 displayValue: false,//是否在条形码下方显示文字 textPosition: "bottom",//设置文本的垂直位置 }) });