UNPKG

@varlet/ui

Version:

A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.

16 lines (15 loc) 440 B
import { assert } from "@varlet/shared"; import { useParent } from "@varlet/use"; import { SWIPE_BIND_SWIPE_ITEM_KEY } from "../swipe/provide.mjs"; function useSwipe() { const { bindParent, index, parentProvider } = useParent(SWIPE_BIND_SWIPE_ITEM_KEY); assert(!!bindParent, "SwipeItem", "<var-swipe-item/> must in <var-swipe/>"); return { index, swipe: parentProvider, bindSwipe: bindParent }; } export { useSwipe };