mirror of
				https://github.com/antd-tiny-vue/antd-tiny-vue.git
				synced 2025-11-01 01:01:44 +08:00 
			
		
		
		
	chore: resolve reflict
This commit is contained in:
		| @@ -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(<button class={cls}>{slots.default?.()}</button>) | ||||
|       return wrapSSR(<button class={[cls, attrs.class]}>{slots.default?.()}</button>) | ||||
|     } | ||||
|   } | ||||
| }) | ||||
|  | ||||
| export default Button | ||||
|   | ||||
| @@ -77,6 +77,6 @@ export function useToken(): [ComputedRef<Theme<SeedToken, MapToken>>, 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<string>] | ||||
|  | ||||
| export type GenerateStyle<ComponentToken extends object = AliasToken, ReturnType = CSSInterpolation> = (token: ComponentToken) => ReturnType | ||||
|   | ||||
| @@ -92,7 +92,7 @@ export default function genComponentStyleHook<ComponentName extends OverrideComp | ||||
|         flush(component, mergedComponentToken) | ||||
|         return [genCommonStyle(token.value, prefixCls.value), styleInterpolation] | ||||
|       }), | ||||
|       hashId.value | ||||
|       hashId | ||||
|     ] | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -2,11 +2,13 @@ import type { Theme } from 'vitepress' | ||||
| // eslint-disable-next-line import/no-named-as-default | ||||
| import DefaultTheme from 'vitepress/theme' | ||||
| import { AntdTheme } from 'vite-plugin-vitepress-demo/theme' | ||||
| import Antd from '../../../components' | ||||
|  | ||||
| export default { | ||||
|   ...DefaultTheme, | ||||
|   enhanceApp(ctx) { | ||||
|     DefaultTheme.enhanceApp?.(ctx) | ||||
|     ctx.app.component('Demo', AntdTheme) | ||||
|     ctx.app.use(Antd) | ||||
|   } | ||||
| } as Theme | ||||
|   | ||||
| @@ -10,7 +10,9 @@ title: 基础按钮 | ||||
| <script lang="ts" setup></script> | ||||
|  | ||||
| <template> | ||||
|   <div></div> | ||||
|   <div> | ||||
|     <a-button>这是按钮</a-button> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <style scoped></style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user