UNPKG

mine-h5-ui

Version:

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

53 lines (52 loc) 1.61 kB
import { defineComponent as y, createElementBlock as r, openBlock as s, unref as e, normalizeStyle as a, createElementVNode as i, renderSlot as d, Fragment as $, renderList as x } from "vue"; import { useHandler as S } from "./hooks.js"; /*! * mine-h5-ui v2.15.0 * Copyright (c) 2025 biaov * @license MIT */ const _ = ["data-index"], H = /* @__PURE__ */ y({ name: "MeVirtualList", __name: "index", props: { list: { default: () => [] }, interval: { default: 100 }, height: { default: "100%" }, itemHeight: { default: 0 }, distance: { default: 50 }, screen: { default: () => [1, 1] }, remain: { default: 8 } }, emits: ["load-more"], setup(u, { emit: m }) { const f = m, c = u, { scrollBarHeight: p, scrollTranslateY: h, renderData: g, onScroll: n, setItemRef: v } = S(c, f); return (l, o) => (s(), r("div", { class: "me-virtual-list", style: a(`height:${l.height};`), onScrollPassive: o[0] || (o[0] = //@ts-ignore (...t) => e(n) && e(n)(...t)) }, [ i("div", { class: "scroll-bar", style: a(`height:${e(p)}px;`) }, null, 4), i("ul", { class: "list-scroll", style: a(`transform:translateY(${e(h)}px);`) }, [ (s(!0), r($, null, x(e(g), (t) => (s(), r("li", { key: t.virtualId, "data-index": t.virtualId, ref_for: !0, ref: e(v) }, [ d(l.$slots, "default", { item: t }) ], 8, _))), 128)) ], 4), d(l.$slots, "more") ], 36)); } }); export { H as default };