ant-design-vue/components/config-provider/SizeContext.tsx

15 lines
349 B
TypeScript
Raw Normal View History

import { defineComponent, PropType, provide } from 'vue';
2020-09-29 14:06:01 +00:00
export type SizeType = 'small' | 'middle' | 'large' | undefined;
export const SizeContextProvider = defineComponent({
props: {
size: String as PropType<SizeType>,
},
setup(props, { slots }) {
provide('sizeProvider', props.size);
return () => slots.default?.();
},
});