【发布时间】:2016-05-18 12:35:03
【问题描述】:
我已经使用 steeve:jquery-qrcode 包创建了 qrcode,但现在我无法根据 _id 集合显示 qrcode 图像(文本)。我想要 _id 数据作为 qrcode 图像,扫描结果是 _id 数据。请有人帮助我。
这是我的代码: //html
`<template name="profile">
<div class="container-fluid">
Username: {{kategori}}<br />
{{#if profil}}
Profile name: {{kategori}}
{{/if}}
<div class="qrblock" id="qrblock" src="/{{. }}"> </div>
<a id="downloadImgLink" onclick="$('#downloadImgLink').attr('href', $('#qrblock canvas')[0].toDataURL());" download="MyImage.png" href="#" target="_blank">Download Drawing</a>
</div>
</template>`
//js
`Template.profile.helpers({
profil: function(){
return Profil.find({});
}
});
Template.profile.onRendered(function (event) {
this. $('.container').qrcode({itemSelector: '.qrblock'});
});`
【问题讨论】: