1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[56,73],{507:function(e,t,o){},562:function(e,t,o){"use strict";o.r(t);o(121),o(11),o(21),o(23);var n=void 0,r={props:{url:{type:String,required:!0},size:{type:Number,required:!1,default:256},color:{type:String,required:!1,default:"#000"},bgColor:{type:String,required:!1,default:"#FFF"},errorLevel:{type:String,validator:function(e){return"L"===e||"M"===e||"Q"===e||"H"===e},required:!1,default:"H"}},watch:{url:function(){n.clear(),n.makeCode(n.url)}},data:function(){return{qrCode:null}},mounted:function(){var e=this;o.e(123).then(o.t.bind(null,724,7)).then((function(t){var o=t.default;e.qrCode=new o(e.$refs.qrcode,{text:e.url,width:e.size,height:e.size,colorDark:e.color,colorLight:e.bgColor,correctLevel:o.CorrectLevel[e.errorLevel]})}))},methods:{clear:function(){this.qrcode&&this.qrCode.clear()},makeCode:function(e){this.qrcode&&this.qrCode.makeCode(e)}}},i=o(41),c=Object(i.a)(r,(function(){return(0,this._self._c)("div",{ref:"qrcode"})}),[],!1,null,null,null);t.default=c.exports},580:function(e,t,o){"use strict";o(507)},732:function(e,t,o){"use strict";o.r(t);o(252),o(116),o(112),o(11),o(42),o(115);var n=o(562),r="https://better-scroll.github.io/examples/#/",i={name:"demo",components:{QrCode:n.default},props:{qrcodeUrl:{type:String,default:""},renderCode:{type:Boolean,default:!1},hideQrcode:{type:Boolean,default:!1}},computed:{fullQrcodeUrl:function(){return"".concat(r).concat(this.qrcodeUrl)},codeIconColor:function(){return this.showCode?"#000":"#666"},codeIconWidth:function(){return this.showCode?3:2}},data:function(){return{showCode:this.renderCode,copied:!1,codeNavIndex:0,codeNavConfigs:[]}},created:function(){this.makeCodeNavConfigs()},methods:{toggleCode:function(){this.showCode=!this.showCode},toPreview:function(){window.open("".concat(r).concat(this.qrcodeUrl))},copyCode:function(){var e=this,t=this.$el.querySelectorAll("pre")[this.codeNavIndex];t.setAttribute("contenteditable","true"),t.focus(),document.execCommand("selectAll",!1,null),this.copied=document.execCommand("copy"),t.removeAttribute("contenteditable"),setTimeout((function(){e.copied=!1}),1e3)},codeNavBtnHandler:function(e){this.codeNavIndex=e},makeCodeNavConfigs:function(){var e,t=this.$slots,o=[];["code-template","code-script","code-style"].forEach((function(n){t[n]&&(e=n.replace("code-","").replace(/^\S/,(function(e){return e.toUpperCase()})),o.push({title:e,slotName:n}))})),this.codeNavConfigs=o}}},c=(o(580),o(41)),s=Object(c.a)(i,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"demo-wrap"},[t("div",{staticClass:"demo-nav"},[t("i",{staticClass:"demo-nav-btn icon-code",on:{click:e.toggleCode}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:e.codeIconColor}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":e.codeIconWidth,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"}})])]),e._v(" "),e.hideQrcode?e._e():t("v-popover",{attrs:{placement:"right",offset:10,trigger:"click"}},[t("i",{staticClass:"demo-nav-btn icon-qrcode"},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"#666"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z"}})])]),e._v(" "),t("template",{slot:"popover"},[t("qr-code",{attrs:{url:e.fullQrcodeUrl,size:100,"error-level":"L"}})],1)],2),e._v(" "),t("i",{staticClass:"demo-nav-btn icon-preview",on:{click:e.toPreview}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"#666"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}})])])],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showCode,expression:"showCode"}],staticClass:"demo-code"},[t("div",{staticClass:"demo-code-nav"},e._l(e.codeNavConfigs,(function(o,n){return t("button",{class:["demo-code-btn",e.codeNavIndex===n?"active":""],on:{click:function(t){return e.codeNavBtnHandler(n)}}},[e._v(e._s(o.title))])})),0),e._v(" "),t("div",{staticClass:"demo-code-content"},[e._l(e.codeNavConfigs,(function(o,n){return t("div",{directives:[{name:"show",rawName:"v-show",value:e.codeNavIndex===n,expression:"codeNavIndex === index"}],staticClass:"demo-code-item"},[e._t(o.slotName)],2)})),e._v(" "),t("i",{staticClass:"demo-code-content-copy",on:{click:e.copyCode}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"#ccc"}},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"}})])]),e._v(" "),t("transition",{attrs:{name:"slide-fade"}},[e.copied?t("span",{staticClass:"demo-code-content-copied"},[e._v("Copied")]):e._e()])],2)]),e._v(" "),t("div",{staticClass:"demo-main"},[t("div",{staticClass:"demo-component-wrap"},[e._t("demo")],2)])])}),[],!1,null,null,null);t.default=s.exports}}]);
|