UNPKG

mine-h5-ui

Version:

一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍

50 lines (49 loc) 1.43 kB
import { defineComponent as f, openBlock as a, createElementBlock as i, normalizeStyle as m, unref as e, normalizeClass as h, createElementVNode as s, toDisplayString as n, createCommentVNode as u } from "vue"; import { name as l, typeGroup as d } from "./config.js"; import { useHandle as x } from "./hooks.js"; import { useCssVar as y } from "../MeComposable/useCssVar/index.js"; const p = ["viewBox", "width", "height"], g = { x: "50%", y: "50%", class: "text", "dominant-baseline": "central" }, v = { x: "50%", y: "50%", class: "text cover", "dominant-baseline": "central" }, w = { key: 1, class: "border" }, V = /* @__PURE__ */ f({ name: l, __name: "index", props: { type: { default: "default" }, size: { default: 24 }, family: { default: "Arial" }, color: { default: "#409eff" }, background: { default: "#fff" }, text: {} }, setup(t) { const c = t, { rect: o, viewBox: r } = x(c); return (b, k) => (a(), i("div", { class: h(e(l)), style: m(e(y)(e(o))) }, [ t.type === e(d).default ? (a(), i("svg", { key: 0, viewBox: `0 0 ${e(r).width} ${e(r).height}`, width: e(o).width, height: e(o).height }, [ s("text", g, n(t.text), 1), s("text", v, n(t.text), 1) ], 8, p)) : t.type === e(d).border ? (a(), i("div", w, n(t.text), 1)) : u("", !0) ], 6)); } }); export { V as default };