Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序,自定义组件中使用wxbarcode,canvas绘制的条形码不会显示 #16

Open
LiyingHong opened this issue Jan 30, 2020 · 2 comments

Comments

@LiyingHong
Copy link

有否出现过这种问题?

@zhoubapi999
Copy link

我也遇到了,请问是咋解决的

@zhoubapi999
Copy link

解决了,自定义组件得当前页面得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))
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants