antd-tiny-vue/components/_util/hooks/size.ts

10 lines
400 B
TypeScript
Raw Normal View History

2023-03-27 07:51:19 +08:00
import type { ComputedRef } from 'vue'
import { computed } from 'vue'
import type { SizeType } from '../../config-provider/context'
import { useProviderConfigState } from '../../config-provider/context'
export const useSize = (props: Record<string, any>) => {
const { componentSize } = useProviderConfigState()
return computed(() => props.size || componentSize.value) as ComputedRef<SizeType>
}