UNPKG

motion-v

Version:

<p align="center"> <img width="100" height="100" alt="Motion logo" src="https://user-images.githubusercontent.com/7850794/164965523-3eced4c4-6020-467e-acde-f11b7900ad62.png" /> </p> <h1 align="center">Motion for Vue</h1>

33 lines (32 loc) 992 B
import { defineComponent, computed, renderSlot } from "vue"; import { defaultConfig, useMotionConfig, provideMotionConfig } from "./context.mjs"; const _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: "MotionConfig", inheritAttrs: false }, __name: "MotionConfig", props: { transition: {}, reduceMotion: { default: defaultConfig.reduceMotion }, nonce: {}, inViewOptions: {} }, setup(__props) { const props = __props; const parentConfig = useMotionConfig(); const config = computed(() => ({ transition: props.transition ?? parentConfig.value.transition, reduceMotion: props.reduceMotion ?? parentConfig.value.reduceMotion, nonce: props.nonce ?? parentConfig.value.nonce, inViewOptions: props.inViewOptions ?? parentConfig.value.inViewOptions })); provideMotionConfig(config); return (_ctx, _cache) => { return renderSlot(_ctx.$slots, "default"); }; } }); export { _sfc_main as default };