UNPKG

@wfrog/vc

Version:

vue3 组件库 vc

20 lines (16 loc) 554 B
import { inject, computed, unref } from 'vue'; import { z as buildProp } from './E_WRn0OP.mjs'; const componentSizes = ["", "default", "small", "large"]; const useSizeProp = buildProp({ type: String, values: componentSizes, required: false }); const SIZE_INJECTION_KEY = Symbol("size"); const useGlobalSize = () => { const injectedSize = inject(SIZE_INJECTION_KEY, {}); return computed(() => { return unref(injectedSize.size) || ""; }); }; export { SIZE_INJECTION_KEY as S, useGlobalSize as a, componentSizes as c, useSizeProp as u };