mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
82 lines (81 loc) • 2.78 kB
JavaScript
import { defineComponent as B, createElementBlock as i, createCommentVNode as l, unref as t, openBlock as a, normalizeStyle as T, normalizeClass as f, createElementVNode as s, withModifiers as g, toDisplayString as u, withDirectives as h, isRef as w, vModelText as M } from "vue";
import { useShow as D } from "./hooks.js";
/*!
* mine-h5-ui v2.15.0
* Copyright (c) 2025 biaov
* @license MIT
*/
const S = { class: "tips" }, V = {
key: 0,
class: "text"
}, x = {
key: 1,
class: "prompt"
}, z = { class: "label" }, E = ["innerHTML"], F = { class: "btn" }, N = /* @__PURE__ */ B({
name: "MeMessageBox",
__name: "index",
props: {
tips: { default: "提示" },
type: { default: "alert" },
message: { default: "" },
html: { default: "" },
cancelButtonText: { default: "取消" },
confirmButtonText: { default: "确认" },
onOk: { type: Function, default: () => () => {
} },
onOff: { type: Function, default: () => () => {
} }
},
emits: ["action"],
setup(c, { emit: y }) {
const k = y, b = c, { isShow: p, isDestroy: v, inputValue: m, onCancel: r, onConfirm: d, animationDuration: C } = D(b, k);
return (e, n) => t(v) ? l("", !0) : (a(), i("div", {
key: 0,
class: f(["me-message-box", { show: t(p) }]),
onClick: n[4] || (n[4] = //@ts-ignore
(...o) => t(r) && t(r)(...o)),
style: T(`--animation-duration:${t(C)}ms;`)
}, [
s("div", {
class: f(["picker", { show: t(p) }]),
onClick: n[3] || (n[3] = g(() => {
}, ["stop"]))
}, [
s("h3", S, u(e.tips), 1),
["alert", "confirm"].includes(e.type) ? (a(), i("div", V, u(e.message), 1)) : l("", !0),
e.type === "prompt" ? (a(), i("div", x, [
s("label", z, u(e.message), 1),
h(s("input", {
type: "text",
class: "input",
"onUpdate:modelValue": n[0] || (n[0] = (o) => w(m) ? m.value = o : null)
}, null, 512), [
[M, t(m)]
])
])) : l("", !0),
e.type === "custom" ? (a(), i("div", {
key: 2,
innerHTML: e.html
}, null, 8, E)) : l("", !0),
s("div", F, [
e.type !== "alert" ? (a(), i("button", {
key: 0,
type: "button",
class: "btn-cancel",
onClick: n[1] || (n[1] = //@ts-ignore
(...o) => t(r) && t(r)(...o))
}, u(e.cancelButtonText), 1)) : l("", !0),
s("button", {
type: "button",
class: "btn-confirm",
onClick: n[2] || (n[2] = //@ts-ignore
(...o) => t(d) && t(d)(...o))
}, u(e.confirmButtonText), 1)
])
], 2)
], 6));
}
});
export {
N as default
};