mirror of
https://github.com/antd-tiny-vue/antd-tiny-vue.git
synced 2025-07-28 02:49:03 +08:00
feat: add button
This commit is contained in:
8
components/_util/hooks/disabled.ts
Normal file
8
components/_util/hooks/disabled.ts
Normal file
@ -0,0 +1,8 @@
|
||||
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>
|
||||
}
|
Reference in New Issue
Block a user