3 Star 19 Fork 3

BuerPHP低代码开发套件 / layui-qrcode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

layui_qrcode

layui生成二维码的扩展进阶用法

指定二维码的生成方式:

可以在调用函数的同时输入想要的二维码生成方式(table/canvas)。

//使用table生成
 $('#qrcode').qrcode({
 	render: "table",
 	text: "http://www.buersoft.cn"
 });

//使用canvas生成 $('#qrcode').qrcode({ render: "canvas", text: "http://www.buersoft.cn" });

指定生成二维码的大小:

可以在调用函数的同时输入想要生成二维码的宽度和高度即可指定生成的二维码的大小。

//生成100*100(宽度100,高度100)的二维码
$('#qrcode').qrcode({
render: "canvas", //也可以替换为table
width: 100,
height: 100,
text: "http://www.buersoft.cn"
});

指定生成二维码的色彩样式:

可以在调用函数的同时输入想要生成二维码的前景色和背景色即可指定生成的二维码的色彩样式。

//生成前景色为红色背景色为白色的二维码
$('#qrcode').qrcode({
render: "canvas", //也可以替换为table
foreground: "#C00",
background: "#FFF",
text: "http://www.buersoft.cn"
});

中文ULR生成方法:

 $("#output").qrcode(encodeURI("http://中文中文"));//使用encodeURI进行转码
MIT License Copyright (c) 2020 倒车的螃蟹 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

需要一个layui二维码生成的扩展,社区貌似没有,于是将一个 jquery二维码生成的插件封装为layui扩展,顺便分享给需要同样功能的朋友。 展开 收起
HTML
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/buersoft/layui-qrcode.git
git@gitee.com:buersoft/layui-qrcode.git
buersoft
layui-qrcode
layui-qrcode
master

搜索帮助