diff --git a/components/button/button.tsx b/components/button/button.tsx index 8419368..4115ff8 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -1,7 +1,7 @@ import { computed, defineComponent } from 'vue' import { useProviderConfigState } from '../config-provider/context' import useStyle from './style' -export default defineComponent({ +const Button = defineComponent({ name: 'AButton', inheritAttrs: false, props: { @@ -9,7 +9,7 @@ export default defineComponent({ type: String } }, - setup(props, { slots }) { + setup(props, { slots, attrs }) { const { getPrefixCls } = useProviderConfigState() const prefixCls = computed(() => getPrefixCls('btn', props.prefixCls)) const [wrapSSR, hashId] = useStyle(prefixCls) @@ -18,7 +18,9 @@ export default defineComponent({ [prefixCls.value]: true, [hashId.value]: true } - return wrapSSR() + return wrapSSR() } } }) + +export default Button diff --git a/components/theme/internal.ts b/components/theme/internal.ts index 4aaed50..c819b2e 100644 --- a/components/theme/internal.ts +++ b/components/theme/internal.ts @@ -77,6 +77,6 @@ export function useToken(): [ComputedRef>, ComputedRe return [mergedTheme, computed(() => cacheToken.value?.[0]), computed(() => (designTokenContext.hashed ? cacheToken.value?.[1] : ''))] } -export type UseComponentStyleResult = [(node: VNodeChild) => VNodeChild, string] +export type UseComponentStyleResult = [(node: VNodeChild) => VNodeChild, ComputedRef] export type GenerateStyle = (token: ComponentToken) => ReturnType diff --git a/components/theme/util/genComponentStyleHook.ts b/components/theme/util/genComponentStyleHook.ts index 5033e52..1cf25e0 100644 --- a/components/theme/util/genComponentStyleHook.ts +++ b/components/theme/util/genComponentStyleHook.ts @@ -92,7 +92,7 @@ export default function genComponentStyleHook