mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 13:39:40 +08:00
15 lines
349 B
TypeScript
15 lines
349 B
TypeScript
import { defineComponent, PropType, provide } from 'vue';
|
|
|
|
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?.();
|
|
},
|
|
});
|