UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

103 lines (102 loc) 2.8 kB
import { defineComponent, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeStyle, createVNode, createElementVNode, createCommentVNode } from "vue"; import QrcodeVue from "../../node_modules/qrcode.vue/dist/qrcode.vue.esm.mjs"; import "./index.vue_vue_type_style_index_0_scoped_true_lang.mjs"; import _export_sfc from "../../_virtual/plugin-vue_export-helper.mjs"; const _sfc_main = defineComponent({ name: "CoQrcodeStd", components: { QrcodeVue }, props: { url: { type: String }, margin: { type: Number }, background: { type: String }, foreground: { type: String }, logo: { type: String }, logoW: { type: Number }, logoH: { type: Number }, maxBorder: { type: Number }, maxBorderRadius: { type: Number }, maxBorderColor: { type: String }, QRBorder: { type: Number }, QRBorderColor: { type: String }, QRBorderRadius: { type: Number } }, setup(props) { const maxStyle = computed(() => { return { "--maxBorder": `${props.maxBorder}px`, "--maxBorderColor": `${props.maxBorderColor}`, "--maxBorderRadius": `${props.maxBorderRadius}px` }; }); const QRStyle = computed(() => { return { "--logoW": `${props.logoW}px`, "--logoH": `${props.logoH}px`, "--QRBorder": `${props.QRBorder}px`, "--QRBorderColor": `${props.QRBorderColor}`, "--QRBorderRadius": `${props.QRBorderRadius}px`, "--QRbackgroundColor": `${props.QRBorderRadius}` }; }); return { ...toRefs(props), maxStyle, QRStyle }; } }); const _hoisted_1 = ["src"]; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_qrcode_vue = resolveComponent("qrcode-vue"); return openBlock(), createElementBlock("div", { class: "co-qrcode-std", style: normalizeStyle(_ctx.maxStyle) }, [ createVNode(_component_qrcode_vue, { style: { "width": "100%", "height": "100%" }, size: 1080, value: _ctx.url, margin: _ctx.margin || 5, level: "H", background: _ctx.background || `#fff`, foreground: _ctx.foreground || `#000` }, null, 8, ["value", "margin", "background", "foreground"]), _ctx.logo ? (openBlock(), createElementBlock("section", { key: 0, class: "logo shadowed", style: normalizeStyle(_ctx.QRStyle) }, [ createElementVNode("img", { src: _ctx.logo }, null, 8, _hoisted_1) ], 4)) : createCommentVNode("", true) ], 4); } var Qrcode = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a2a59b04"]]); export { Qrcode as default };