feat: add button

This commit is contained in:
2023-03-27 07:51:19 +08:00
parent 2b2ef3a3fb
commit 3ba0d997d5
8 changed files with 265 additions and 22 deletions

View 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>
}

View 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>
}