mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
56 lines (55 loc) • 2.14 kB
JavaScript
import { defineComponent as $, mergeModels as m, useModel as k, createElementBlock as w, openBlock as u, createElementVNode as i, withModifiers as f, unref as e, normalizeStyle as p, renderSlot as x, createBlock as S, createCommentVNode as N, createTextVNode as g, toDisplayString as C } from "vue";
import E from "../MeLoading/index.vue.js";
import { useHandMove as I } from "./hooks.js";
/*!
* mine-h5-ui v2.15.0
* Copyright (c) 2025 biaov
* @license MIT
*/
const Y = { class: "me-pull-refresh" }, P = /* @__PURE__ */ $({
name: "MePullRefresh",
__name: "index",
props: /* @__PURE__ */ m({
loadText: { default: () => ["下拉即可刷新...", "释放即可刷新...", "加载中...", "刷新成功"] },
loadIcon: { type: Boolean, default: !0 }
}, {
modelValue: { type: Boolean, default: !1 },
modelModifiers: {}
}),
emits: /* @__PURE__ */ m(["refresh"], ["update:modelValue"]),
setup(c, { emit: v }) {
const T = v, M = k(c, "modelValue"), { activeState: l, transY: V, scale: y, showValue: h, duration: B, onTouchstart: r, onTouchmove: s, onTouchend: a, onMousedown: d } = I({ emit: T, modelValue: M });
return (n, o) => (u(), w("div", Y, [
i("div", {
class: "cont",
style: p(`transform: translateY(${e(V) - e(h)}px);transition-duration: ${e(B)}ms;`),
onTouchstart: o[0] || (o[0] = f(
//@ts-ignore
(...t) => e(r) && e(r)(...t),
["prevent"]
)),
onTouchmove: o[1] || (o[1] = //@ts-ignore
(...t) => e(s) && e(s)(...t)),
onTouchend: o[2] || (o[2] = //@ts-ignore
(...t) => e(a) && e(a)(...t)),
onMousedown: o[3] || (o[3] = f(
//@ts-ignore
(...t) => e(d) && e(d)(...t),
["prevent"]
))
}, [
i("div", {
class: "hd",
style: p(`transform:scale(${e(y)});`)
}, [
n.loadIcon && e(l) === 2 ? (u(), S(E, { key: 0 })) : N("", !0),
g(" " + C(n.loadText[e(l)]), 1)
], 4),
x(n.$slots, "default")
], 36)
]));
}
});
export {
P as default
};