UNPKG

winbox-ui-next

Version:

We Design Vue 2.0: A Vue.js 3 UI Library

14 lines (13 loc) 529 B
import { inject, computed } from "vue"; import { configProviderInjectionKey } from "../config-provider/context.js"; const useSize = (size, { defaultValue = "default" } = {}) => { const configProviderCtx = inject(configProviderInjectionKey, void 0); const mergedSize = computed(() => { var _a, _b; return (_b = (_a = size == null ? void 0 : size.value) != null ? _a : configProviderCtx == null ? void 0 : configProviderCtx.size) != null ? _b : defaultValue; }); return { mergedSize }; }; export { useSize };