sansnn / uqrcode Goto Github PK
View Code? Open in Web Editor NEW全端二维码生成插件
License: Apache License 2.0
全端二维码生成插件
License: Apache License 2.0
项目案例里的网络图片不显示,什么问题呢?
npm 模块名不能随便改呀。 你想调整也该保留旧的呀 u-qrcode
请问这个插件支持生成小程序码么?带参数的那种,需要做分享建立上下级关系的功能。
转换图片不成功啊
<view class="content">
<u-qrcode ref="qrcode" canvas-id="qrcode" :size="size" :value="text" ></u-qrcode>
</view>
reportJSException >>>> exception function:gcanvas setBackGround for android view, exception:WX_RENDER_ERR_TEXTURE_SETBACKGROUND: TextureView doesn't support displaying a background drawable!
uniapp编码
在小程序中,使用原生的canvas
<canvas canvas-id="qrcode" id="qrcode" ref="qrcode" style="width: 300px; height: 300px;" type="2d"/>
var qr = new UQRCode();
// 设置二维码内容
qr.data = "http://XXXX.com";
// 设置二维码大小,必须与canvas设置的宽高一致
qr.size = 300;
// 调用制作二维码方法
qr.foregroundImageSrc = 'base64图片';
qr.make();
// 获取canvas上下文
const query = uni.createSelectorQuery();
query.select('#qrcode').node().exec((res) => {
const canvas = res[0].node;
const canvasContext = canvas.getContext('2d');
qr.canvasContext = canvasContext;
// 调用绘制方法将二维码图案绘制到canvas上
qr.drawCanvas();
})
foregroundImageSrc 设置了图片,真机,微信小程序的开发工具均显示空白
const query = wx.createSelectorQuery()
query.select('#qrcode')
.fields({ node: true, size: true })
.exec((res) => {
const canvas = res[0].node
const ctx = canvas.getContext('2d')
canvas.width = 400
canvas.height = 400
const qr = new UQRCode();
qr.size = 400
qr.backgroundImageSrc = base64data
console.log('qrbb', qr.backgroundImageSrc)
qr.foregroundColor = '#5EB8FF'
qr.make();
qr.canvasContext = ctx;
qr.drawCanvas()
})
})
},
fail: (fail) => {
console.log('fail', fail)
},
})
qr.backgroundImageSrc = base64data 已经测试过base64可以正常显示
报错为[uQRCode]: backgroundImageSrc invalid!
老师你好,感谢提供好用的uQRCode
目前,二维码中间可以显示一个 logo 图片,
如果能显示指定文字就更好了
请问有没有考虑实现可以显示文字
的功能呢?
nvue页面中引用报错 TypeError: undefined is not an object (evaluating 'this.$scope.$page')
目前是不支持nvue吗?代码中并没有看到这个报错的相关引用,可以给点思路吗,我想能不能改一部分代码适配nvue
微信小程序skyline引擎貌似渲染不了 显示空白
希望可以支持vue3+ts项目增加type包
在 vue 工程中用下面的方式导入后:
import UQRCode from 'uqrcodejs';
IDE 飘红,报错无法找到模块“uqrcodejs”的声明文件。请问方便维护一下对应的 @types 包吗。
if (true) {
const UQRCode = await import('uqrcodejs');
}
执行上面的代码报错:
Uncaught (in promise) TypeError: UQRCode is not a constructor
我有个一个数组,里面一共有9个数据,我在success里面push"res"到新数组,但是我用手机扫一下二维码,全部二维码都是数组里面的最后一个数据. 本人虚心请教 感谢!!!
用的uniapp
,但是没有用组件,而是原生的:
makeQr(value) {
// 获取uQRCode实例
let qr = new UQRCode();
// 设置二维码内容
let baseUrl = window.location.origin;
qr.data = baseUrl + value;
// 设置二维码大小,必须与canvas设置的宽高一致
qr.size = this.size;
// 调用制作二维码方法
qr.make();
// 设置uQRCode实例的canvas上下文
qr.canvasContext = uni.createCanvasContext('qrcode', this);
// 调用绘制方法将二维码图案绘制到canvas上
qr.drawCanvas();
}
定时会更改make(value)
中的value
的值,但是只会在第一次生成二维码,后续调用生成二维码不会刷新。
readme.md 好像有个属性写错了, uniApp中的二维码内容字段是text而不是value。
微信小程序中,ios生成的二维码能正常识别,安卓不行。
大家又遇到过这个问题么?
vue3 组合方式的API没有this
但是插件在使用组件方式要调用this,怎么使用
老师你好,感谢提供好用的uQRCode
目前,二维码可以下载为图片,
如果在下载时(调用 save
方法)能指定图片的文件名就更好了
请问有没有考虑实现可以指定文件名
的功能呢?
开发工具内显示正常,但是真机无法显示
配置为 mode="canvas" file-type="png"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.