UNPKG

@opensig/opendesign

Version:

<p align="center"><img src="../docs/public/opendesign-logo-light.png"/></p> <h1 align="center">opendesign</h1> <p align="center">一个 Vue 3 组件库</p> <p align="center"><b>皮肤可定制,使用 TypeScript</b></p>

69 lines (68 loc) 2.07 kB
import { defineComponent, ref, createElementBlock, openBlock, createElementVNode, createVNode, normalizeClass, renderSlot, withCtx } from "vue"; import _sfc_main$1 from "./OScrollbar.vue.mjs"; import { scrollerProps } from "./types.mjs"; const _hoisted_1 = { class: "o-scroller o-scrollbar-wrapper" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "OScroller", props: scrollerProps, setup(__props, { expose: __expose }) { const props = __props; const targetRef = ref(null); const scrollTo = (options) => { if (!targetRef.value) { return; } targetRef.value.scrollTo(options); }; __expose({ scrollTo, getContainerEl() { return targetRef.value; } }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1, [ createElementVNode( "div", { ref_key: "targetRef", ref: targetRef, class: normalizeClass(["o-scroller-container", [ { "is-x-disabled": props.disabledX, "is-y-disabled": props.disabledY }, props.wrapClass ]]) }, [ renderSlot(_ctx.$slots, "default") ], 2 /* CLASS */ ), createVNode(_sfc_main$1, { target: targetRef.value, "disabled-x": props.disabledX, "disabled-y": props.disabledY, duration: props.duration, "show-type": props.showType, size: props.size, "auto-update-on-scroll-size": props.autoUpdateOnScrollSize }, { thumb: withCtx(() => [ renderSlot(_ctx.$slots, "thumb") ]), track: withCtx(() => [ renderSlot(_ctx.$slots, "track") ]), _: 3 /* FORWARDED */ }, 8, ["target", "disabled-x", "disabled-y", "duration", "show-type", "size", "auto-update-on-scroll-size"]) ]); }; } }); export { _sfc_main as default };