fix: custom class (#6217)

pull/6220/head
zkwolf 2023-01-29 14:50:30 +08:00 committed by GitHub
parent 94e981e00b
commit 337d958c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -152,8 +152,10 @@ export default defineComponent({
const breadcrumbClassName = { const breadcrumbClassName = {
[prefixCls.value]: true, [prefixCls.value]: true,
[`${prefixCls.value}-rtl`]: direction.value === 'rtl', [`${prefixCls.value}-rtl`]: direction.value === 'rtl',
[`${attrs.class}`]: !!attrs.class,
[hashId.value]: true, [hashId.value]: true,
}; };
return wrapSSR( return wrapSSR(
<nav {...attrs} class={breadcrumbClassName}> <nav {...attrs} class={breadcrumbClassName}>
<ol>{crumbs}</ol> <ol>{crumbs}</ol>

View File

@ -162,10 +162,11 @@ export const descriptionsContext: InjectionKey<DescriptionsContextProp> =
const Descriptions = defineComponent({ const Descriptions = defineComponent({
compatConfig: { MODE: 3 }, compatConfig: { MODE: 3 },
name: 'ADescriptions', name: 'ADescriptions',
inheritAttrs: false,
props: descriptionsProps(), props: descriptionsProps(),
slots: ['title', 'extra'], slots: ['title', 'extra'],
Item: DescriptionsItem, Item: DescriptionsItem,
setup(props, { slots }) { setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('descriptions', props); const { prefixCls, direction } = useConfigInject('descriptions', props);
let token: number; let token: number;
const screens = ref<ScreenMap>({}); const screens = ref<ScreenMap>({});
@ -208,6 +209,7 @@ const Descriptions = defineComponent({
return wrapSSR( return wrapSSR(
<div <div
{...attrs}
class={[ class={[
prefixCls.value, prefixCls.value,
{ {
@ -215,6 +217,7 @@ const Descriptions = defineComponent({
[`${prefixCls.value}-bordered`]: !!bordered, [`${prefixCls.value}-bordered`]: !!bordered,
[`${prefixCls.value}-rtl`]: direction.value === 'rtl', [`${prefixCls.value}-rtl`]: direction.value === 'rtl',
}, },
attrs.class,
hashId.value, hashId.value,
]} ]}
> >

View File

@ -79,6 +79,7 @@ const Divider = defineComponent({
children.length children.length
? `${prefixClsRef.value}-with-text ${prefixClsRef.value}-with-text${orientationPrefix.value}` ? `${prefixClsRef.value}-with-text ${prefixClsRef.value}-with-text${orientationPrefix.value}`
: '', : '',
attrs.class,
]} ]}
role="separator" role="separator"
> >