tyh-ui2
Version:
The next generation ui component library of tyh-ui is based on vue3 Version, fully embrace vue3.
42 lines (41 loc) • 1.15 kB
JavaScript
import { defineComponent as a, computed as u, openBlock as t, createElementBlock as s, normalizeClass as c, unref as h, createElementVNode as d, createCommentVNode as r, createTextVNode as f, toDisplayString as _ } from "vue";
import { Props as g } from "./index2.js";
const k = { class: "tyh-alert-message" }, C = a({
name: "TyhAlert"
}), b = /* @__PURE__ */ a({
...C,
props: g,
emits: ["close"],
setup(l, { emit: i }) {
const m = l, p = u(() => {
const { type: e, center: n, simple: y } = m;
return [
"tyh-alert",
`tyh-alert-${e}`,
{
"tyh-alert-center": n,
[`tyh-alert-bac-${e}`]: !y
}
];
}), o = () => i("close");
return (e, n) => (t(), s("div", {
class: c(h(p))
}, [
d("div", k, [
e.icon ? (t(), s("i", {
key: 0,
class: c(["tyh-icon", "tyh-message-icon", e.icon])
}, null, 2)) : r("", !0),
f(" " + _(e.message), 1)
]),
o ? (t(), s("i", {
key: 0,
class: "tyh-icon tyh-ui-guanbi",
onClick: o
})) : r("", !0)
], 2));
}
});
export {
b as default
};