UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

38 lines (37 loc) 1.15 kB
import { defineComponent as c, useTemplateRef as m, createElementBlock as f, openBlock as y, unref as e, normalizeClass as b, createElementVNode as d, withModifiers as k, normalizeStyle as w } from "vue"; import { useThumb as E } from "./hook/useThumb.mjs"; const _ = /* @__PURE__ */ c({ __name: "thumb", props: { vertical: { type: Boolean }, size: {}, move: {}, ratio: {}, always: { type: Boolean } }, setup(i) { const r = i, n = m("trackEl"), l = m("thumbEl"), { bar: u, thumbStyle: p, onMousedown: s, onThumbPointerDown: a } = E(r, n, l); return (h, o) => (y(), f("div", { ref_key: "trackEl", ref: n, class: b(["scroll-track", [e(u).key, { "is-always": r.always }]]), onPointerdown: o[1] || (o[1] = //@ts-ignore (...t) => e(s) && e(s)(...t)) }, [ d("div", { ref_key: "thumbEl", ref: l, class: "scroll-thumb", style: w(e(p)), onPointerdown: o[0] || (o[0] = k( //@ts-ignore (...t) => e(a) && e(a)(...t), ["stop", "prevent"] )) }, null, 36) ], 34)); } }); export { _ as default };