UNPKG

fv-ui

Version:

Vite + Vue3 + TS + Element-plus自定义组件库

135 lines (134 loc) 3.76 kB
import { defineComponent as h, ref as p, resolveComponent as v, createElementBlock as c, openBlock as s, Fragment as T, createBlock as w, createCommentVNode as g, createVNode as _, normalizeProps as k, mergeProps as d, withCtx as m, renderSlot as y, createElementVNode as C, watch as E, onMounted as $, onActivated as b, normalizeClass as D, guardReactiveProps as N, unref as z } from "vue"; const L = /* @__PURE__ */ h({ name: "EButton", __name: "index", props: { tip: {}, placement: {}, tipProps: {}, isDebounce: { type: Boolean, default: !0 }, time: { default: 500 } }, emits: ["click"], setup(t, { emit: o }) { const a = t, l = o, n = p(0), u = () => { if (!a.isDebounce) return l("click"); const e = (/* @__PURE__ */ new Date()).getTime(); e - n.value > a.time && l("click"), n.value = e; }; return (e, r) => { const i = v("el-button"), f = v("el-tooltip"); return s(), c(T, null, [ e.$attrs.content ? (s(), w(f, k(d({ key: 0 }, e.$attrs)), { default: m(() => [ _(i, d(e.$attrs, { onClick: u }), { default: m(() => [ y(e.$slots, "default") ]), _: 3 }, 16) ]), _: 3 }, 16)) : g("", !0), _(i, d(e.$attrs, { onClick: u }), { default: m(() => [ y(e.$slots, "default") ]), _: 3 }, 16) ], 64); }; } }), M = L; /*! Element Plus Icons Vue v2.3.1 */ var P = /* @__PURE__ */ h({ name: "CaretTop", __name: "caret-top", setup(t) { return (o, a) => (s(), c("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ C("path", { fill: "currentColor", d: "M512 320 192 704h639.936z" }) ])); } }), S = P; const G = { key: 0, class: "back_to_top" }, R = /* @__PURE__ */ h({ name: "ELayout", __name: "index", props: { scrollDisabled: { type: Boolean, default: !1 }, isNoMargin: { type: Boolean, default: !1 }, showGoTopBtn: { type: Boolean, default: !0 }, scrollToTop: { default: 100 } }, setup(t) { const o = t, a = p(!1), l = p(null), n = p(0); E( () => n.value, (e) => a.value = e > o.scrollToTop ); const u = () => { n.value = 0, l.value.scrollTo({ top: 0, behavior: "smooth" }); }; return $(() => { const e = l.value.querySelectorAll(".t_layout_page_item"); e.length === 2 && (e[0].style.marginBottom = "8px"), e.length > 2 && (e.forEach((r) => { r.style.marginBottom = "8px"; }), e[e.length - 1].style.marginBottom = "0"); }), b(() => { o.scrollDisabled || (l.value.scrollTop = n); }), (e, r) => { const i = v("el-icon"); return s(), c("div", { ref_key: "ELayoutRef", ref: l, class: D(["e_layout", { e_layout_no_margin: e.isNoMargin }]), onScroll: r[0] || (r[0] = (f) => n.value = f.target.scrollTop) }, [ y(e.$slots, "default"), e.showGoTopBtn ? (s(), c("div", G, [ a.value ? (s(), c("div", { key: 0, onClick: u }, [ _(i, k(N({ size: 24, ...e.$attrs })), { default: m(() => [ _(z(S)) ]), _: 1 }, 16) ])) : g("", !0) ])) : g("", !0) ], 34); }; } }), V = R, B = [ V, M ], A = "0.0.1", q = (t) => { B.forEach((o) => { t.component(o.name, o); }); }, x = (t) => { q(t); }, I = { ...B, // 按需引入 // 导出的对象必须具有 install,才能被 Vue.use() 方法安装 install: x, version: A //版本号 }; export { I as default };