mirror of
https://github.com/antd-tiny-vue/antd-tiny-vue.git
synced 2024-11-13 11:09:16 +08:00
10 lines
400 B
TypeScript
10 lines
400 B
TypeScript
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>
|
|
}
|