mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
57 lines (56 loc) • 1.79 kB
JavaScript
import { defineComponent as y, openBlock as n, createElementBlock as s, normalizeStyle as l, createElementVNode as o, unref as r, createCommentVNode as k, toDisplayString as a, renderSlot as C } from "vue";
import { useHandler as g } from "./hooks.js";
const b = {
key: 0,
class: "iconfont icon-left"
}, h = { class: "rt" }, $ = /* @__PURE__ */ y({
name: "MeNavBar",
__name: "index",
props: {
title: { default: "" },
leftArrow: { type: Boolean, default: !0 },
leftText: { default: "" },
rightText: { default: "" },
styles: { default: () => ({
borderColor: "#dcdfe6",
background: "#fff",
titleColor: "#494949",
leftColor: "#949494",
rightColor: "#949494"
}) }
},
emits: ["click-left", "click-right"],
setup(t, { emit: f }) {
const m = f, { onClickLeft: c, onClickRight: d } = g(m);
return (u, e) => (n(), s("div", {
class: "me-nav-bar",
style: l(`background:${t.styles.background};border-bottom-color:${t.styles.borderColor};`)
}, [
o("div", {
class: "lf",
style: l(`color:${t.styles.leftColor};`),
onClick: e[0] || (e[0] = //@ts-ignore
(...i) => r(c) && r(c)(...i))
}, [
t.leftArrow ? (n(), s("i", b)) : k("", !0),
o("span", null, a(t.leftText), 1)
], 4),
o("h2", {
class: "tit",
style: l(`color:${t.styles.titleColor};`)
}, a(t.title), 5),
o("div", h, [
t.rightText ? (n(), s("div", {
key: 0,
class: "btn",
style: l(`color:${t.styles.rightColor};`),
onClick: e[1] || (e[1] = //@ts-ignore
(...i) => r(d) && r(d)(...i))
}, a(t.rightText), 5)) : C(u.$slots, "default", { key: 1 })
])
], 4));
}
});
export {
$ as default
};