UNPKG

mine-h5-ui

Version:

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

90 lines (89 loc) 3 kB
import { defineComponent as B, createElementBlock as a, openBlock as i, normalizeStyle as r, createElementVNode as n, unref as e, normalizeClass as k, createBlock as b, Fragment as z, renderList as I, toDisplayString as m, Transition as L, withCtx as S } from "vue"; import { useAnimate as A, useBtns as D } from "./hooks.js"; /*! * mine-h5-ui v2.15.0 * Copyright (c) 2025 biaov * @license MIT */ const E = { class: "notice" }, N = ["onClick"], P = /* @__PURE__ */ B({ name: "MeNoticeBar", __name: "index", props: { list: {}, scroll: { default: "horizontal" }, loop: { type: Boolean, default: !1 }, delay: { default: 3e3 }, preappendIcon: { default: "notice" }, preappendColor: { default: "#f56c6c" }, appendIcon: { default: "right1" }, appendColor: { default: "#c8c7cc" }, height: { default: 40 }, radius: { default: 4 }, background: { default: "#f6f6f6" }, color: { default: "#494949" } }, emits: ["click", "click:preappend", "click:append"], setup(C, { emit: y }) { const $ = y, g = C, { noticeList: h, left: v, listData: c, listIndex: s } = A(g), { onClick: p, onClickPreappend: d, onClickAppend: u } = D($); return (o, l) => (i(), a("div", { class: "me-notice-bar", style: r(`height:${o.height}px;border-radius:${o.radius + (String(o.radius).includes("px") ? "" : "px")};background:${o.background};`) }, [ n("div", { class: "icon icon-preappend", style: r(`color:${o.preappendColor};`), onClick: l[0] || (l[0] = //@ts-ignore (...t) => e(d) && e(d)(...t)) }, [ n("i", { class: k(`iconfont icon-${o.preappendIcon}`) }, null, 2) ], 4), n("div", E, [ o.scroll === "horizontal" ? (i(), a("ul", { key: 0, class: "notice-horizontal", style: r(`left:${e(v)}px;color:${o.color};`), ref_key: "noticeList", ref: h }, [ (i(!0), a(z, null, I(e(c), (t, f) => (i(), a("li", { key: f, onClick: (w) => e(p)(f) }, [ n("span", null, m(t), 1) ], 8, N))), 128)) ], 4)) : (i(), b(L, { key: 1, name: "slide", mode: "out-in" }, { default: S(() => [ (i(), a("div", { class: "notice-vertical", key: e(s), onClick: l[1] || (l[1] = (t) => e(p)(e(s))), style: r(`color:${o.color};`) }, [ n("span", null, m(e(c)[e(s)]), 1) ], 4)) ]), _: 1 })) ]), n("div", { class: "icon icon-append", style: r(`color:${o.appendColor};`), onClick: l[2] || (l[2] = //@ts-ignore (...t) => e(u) && e(u)(...t)) }, [ n("i", { class: k(`iconfont icon-${o.appendIcon}`) }, null, 2) ], 4) ], 4)); } }); export { P as default };