mirror of
https://github.com/antd-tiny-vue/antd-tiny-vue.git
synced 2024-11-10 17:49:18 +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>
|
|
}
|