mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
61 lines (60 loc) • 2.57 kB
JavaScript
import { defineComponent as S, useModel as $, openBlock as s, createBlock as D, Transition as E, withCtx as N, createElementBlock as a, createElementVNode as l, unref as e, Fragment as m, renderList as p, withModifiers as f, normalizeStyle as z, toDisplayString as A, createCommentVNode as F, mergeModels as h } from "vue";
import { useHandMove as H, useBtns as L } from "./hooks.js";
const P = {
key: 0,
class: "me-address-picker"
}, Y = { class: "hd" }, j = { class: "bd" }, q = ["onTouchstart", "onTouchmove", "onTouchend", "onMousedown"], J = /* @__PURE__ */ S({
name: "MeAddressPicker",
__name: "index",
props: /* @__PURE__ */ h({
visible: { type: Boolean, default: !1 },
separator: { default: "-" }
}, {
modelValue: { default: "" },
modelModifiers: {}
}),
emits: /* @__PURE__ */ h(["cancel", "sure"], ["update:modelValue"]),
setup(u, { emit: k }) {
const v = k, y = u, T = $(u, "modelValue"), { listData: M, distance: b, duration: i, currentValue: V, onTouchstart: C, onTouchmove: w, onTouchend: B, onMousedown: _ } = H(), { onCancel: d, onSure: c } = L({ props: y, emit: v, currentValue: V, modelValue: T });
return (x, t) => (s(), D(E, { name: "translate" }, {
default: N(() => [
u.visible ? (s(), a("div", P, [
l("div", Y, [
l("button", {
type: "button",
class: "cancel",
onClick: t[0] || (t[0] = //@ts-ignore
(...r) => e(d) && e(d)(...r))
}, "取消"),
t[2] || (t[2] = l("span", { class: "line" }, null, -1)),
l("button", {
type: "button",
class: "sure",
onClick: t[1] || (t[1] = //@ts-ignore
(...r) => e(c) && e(c)(...r))
}, "确定")
]),
l("ul", j, [
(s(!0), a(m, null, p(e(M), (r, n) => (s(), a("li", {
key: n,
onTouchstart: f((o) => e(C)(o, n), ["prevent"]),
onTouchmove: (o) => e(w)(o, n),
onTouchend: (o) => e(B)(o, n),
onMousedown: f((o) => e(_)(o, n), ["prevent"])
}, [
l("ol", {
style: z(`transform:translateY(${e(b)[n]}px);transition-property:${e(i) > 0 ? "all" : "none"};transition-duration: ${e(i)}ms;`)
}, [
(s(!0), a(m, null, p(r, (o, g) => (s(), a("li", { key: g }, A(o), 1))), 128))
], 4)
], 40, q))), 128))
])
])) : F("", !0)
]),
_: 1
}));
}
});
export {
J as default
};