uv-ui
Version:
基于vue3的移动端组件库
75 lines (74 loc) • 1.73 kB
JavaScript
import { ref as m, watch as g, onMounted as v, openBlock as n, createElementBlock as i, normalizeStyle as p, createElementVNode as d, createCommentVNode as h } from "vue";
import a from "./qrcode.js";
import "./qr-code.vue_vue_type_style_index_0_lang.js";
const y = { class: "uv-qr-code" }, C = ["src"], S = {
name: "UvQrCode"
}, q = /* @__PURE__ */ Object.assign(S, {
props: {
iconUrl: {
type: String,
default: ""
},
iconSize: {
type: Number,
default: 30
},
text: {
type: String,
default: ""
},
codeSize: {
type: Number,
default: 70
},
codeColor: {
type: String,
default: "#000000"
},
codeBgColor: {
type: String,
default: "#ffffff"
},
correctLevel: {
type: String,
default: "H"
}
},
setup(e) {
const r = e, t = m(null), c = () => {
t.value.innerHTML = "";
const { text: l, codeSize: o, codeColor: u, codeBgColor: f, correctLevel: s } = r;
return new a(t.value, {
text: l,
width: o,
height: o,
colorDark: u,
colorLight: f,
correctLevel: a.CorrectLevel[s]
});
};
return g(r, () => {
c();
}), v(() => {
c();
}), (l, o) => (n(), i("div", y, [
e.iconUrl ? (n(), i("div", {
key: 0,
class: "uv-qr-code-img-warp",
style: p({ width: e.iconSize + "px", height: e.iconSize + "px" })
}, [
d("img", {
src: e.iconUrl,
class: "uv-qr-code-img-logo"
}, null, 8, C)
], 4)) : h("", !0),
d("div", {
ref_key: "QrCodeRef",
ref: t
}, null, 512)
]));
}
});
export {
q as default
};