mirror of
https://github.com/antd-tiny-vue/antd-tiny-vue.git
synced 2024-11-15 00:09:14 +08:00
9 lines
353 B
TypeScript
9 lines
353 B
TypeScript
import type { ComputedRef } from 'vue'
|
|
import { computed } from 'vue'
|
|
import { useProviderConfigState } from '../../config-provider/context'
|
|
|
|
export const useDisabled = (props: Record<string, any>) => {
|
|
const { componentDisabled } = useProviderConfigState()
|
|
return computed(() => props.disabled || componentDisabled.value) as ComputedRef<boolean>
|
|
}
|