mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
62 lines (61 loc) • 1.93 kB
JavaScript
import { defineComponent as B, createElementBlock as r, openBlock as s, withModifiers as m, unref as e, normalizeStyle as p, createElementVNode as $, createCommentVNode as C, normalizeClass as f, renderSlot as S, Fragment as V, renderList as x } from "vue";
import { useHandMove as z } from "./hooks.js";
/*!
* mine-h5-ui v2.15.0
* Copyright (c) 2025 biaov
* @license MIT
*/
const D = {
key: 0,
class: "dot"
}, b = /* @__PURE__ */ B({
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(v, { emit: y }) {
const c = y, h = v, { swiperDom: w, dots: g, dotIndex: T, currentValue: k, isActive: M, onTouchstart: l, onTouchmove: a, onTouchend: d, onMousedown: i } = z(h, c);
return (n, o) => (s(), r("div", {
class: "me-swiper",
style: p(`height:${n.height}px;border-radius:${n.radius}px;`),
ref_key: "swiperDom",
ref: w,
onTouchstart: o[0] || (o[0] = m(
//@ts-ignore
(...t) => e(l) && e(l)(...t),
["prevent"]
)),
onTouchmove: o[1] || (o[1] = //@ts-ignore
(...t) => e(a) && e(a)(...t)),
onTouchend: o[2] || (o[2] = //@ts-ignore
(...t) => e(d) && e(d)(...t)),
onMousedown: o[3] || (o[3] = m(
//@ts-ignore
(...t) => e(i) && e(i)(...t),
["prevent"]
))
}, [
$("div", {
class: f(["imgs", { active: e(M) }]),
style: p(`transform:translateX(${e(k)}px);`)
}, [
S(n.$slots, "default")
], 6),
n.dot ? (s(), r("ul", D, [
(s(!0), r(V, null, x(e(g), (t, u) => (s(), r("li", {
key: u,
class: f({ on: e(T) === u })
}, null, 2))), 128))
])) : C("", !0)
], 36));
}
});
export {
b as default
};