wxbarcode
wxbarcode copied to clipboard
微信小程序,自定义组件中使用wxbarcode,canvas绘制的条形码不会显示
有否出现过这种问题?
我也遇到了,请问是咋解决的
解决了,自定义组件得当前页面得this进去,修改如下:
wxbarcode.barcode('barcode', res.data.data.active_code, 620, 150, this); // 生成条形码
function barc(id, code, width, height, that) { barcode.code128(wx.createCanvasContext(id, that), code, convert_length(width), convert_length(height)) }