UNPKG

mine-h5-ui

Version:

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

62 lines (61 loc) 1.95 kB
import { defineComponent as C, createElementBlock as n, openBlock as s, withModifiers as f, unref as e, normalizeStyle as c, normalizeClass as r, createElementVNode as N, createCommentVNode as V, renderSlot as x, Fragment as z, renderList as D } from "vue"; import { useHandMove as E, useStyle as $ } from "./hooks.js"; /*! * mine-h5-ui v2.16.0 * Copyright (c) 2025 biaov * @license MIT */ const A = { key: 0, class: "dot" }, I = /* @__PURE__ */ C({ name: "MeSwiper", __name: "index", props: { loop: { type: Boolean, default: !1 }, delay: { default: 3e3 }, height: {}, dot: { type: Boolean, default: !1 }, radius: { default: 4 } }, emits: ["change"], setup(y, { emit: v }) { const w = v, l = y, { swiperDom: T, dots: k, dotIndex: M, currentValue: S, isActive: g, onTouchstart: a, onTouchmove: d, onTouchend: u, onMousedown: i } = E(l, w), { className: h, renderStyle: B } = $(l); return (m, o) => (s(), n("div", { class: r(["me-swiper", e(h)]), style: c(e(B)), ref_key: "swiperDom", ref: T, onTouchstart: o[0] || (o[0] = f( //@ts-ignore (...t) => e(a) && e(a)(...t), ["prevent"] )), onTouchmove: o[1] || (o[1] = //@ts-ignore (...t) => e(d) && e(d)(...t)), onTouchend: o[2] || (o[2] = //@ts-ignore (...t) => e(u) && e(u)(...t)), onMousedown: o[3] || (o[3] = f( //@ts-ignore (...t) => e(i) && e(i)(...t), ["prevent"] )) }, [ N("div", { class: r(["imgs", { active: e(g) }]), style: c(`transform:translateX(${e(S)}px);`) }, [ x(m.$slots, "default") ], 6), m.dot ? (s(), n("ul", A, [ (s(!0), n(z, null, D(e(k), (t, p) => (s(), n("li", { key: p, class: r({ on: e(M) === p }) }, null, 2))), 128)) ])) : V("", !0) ], 38)); } }); export { I as default };