QRCode_wev8.js 694 Bytes
define("QRCode_html",function(){return'<div id="NMEC_${id}" class="wev-comp-${compType}">\t{@if content == ""}\t<div class="tip">需设置二维码的内容以生成二维码</div>\t{@/if}</div>'}),define(["mUtil","Component"],function(t,e){return e.init(function(t){e.super(this,t),this.type="QRCode",this.tpl=this.type+"_html",this.css=this.type+"_css";var i=this.viewModel={content:"",width:256,logo:"",logoWidth:40,logoHeight:40};this.mounted=function(){if(i.content){var t=this.$el.children(".wev-comp-"+this.type);require(["qrcode"],function(){t.html("").qrcode({render:"canvas",text:i.content,width:i.width,height:i.width,src:i.logo,imgWidth:i.logoWidth,imgHeight:i.logoHeight})})}}})});