mirror of
https://github.com/antd-tiny-vue/antd-tiny-vue.git
synced 2025-07-04 11:03:15 +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>
|
||||
}
|
9
components/_util/hooks/size.ts
Normal file
9
components/_util/hooks/size.ts
Normal file
@ -0,0 +1,9 @@
|
||||
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>
|
||||
}
|
Reference in New Issue
Block a user