fix: space can not inherit attrs (#2902)

pull/3015/head
Sun 2020-09-29 18:28:24 +08:00 committed by GitHub
parent 5c8b77957c
commit 4a3e310db7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 7 deletions

View File

@ -49,18 +49,24 @@ const Space = {
const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;
const someSpaceClass = {
[prefixCls]: true,
[`${prefixCls}-${direction}`]: true,
// [`${prefixCls}-rtl`]: directionConfig === 'rtl',
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
};
const someSpaceClass = [
{
[prefixCls]: true,
[`${prefixCls}-${direction}`]: true,
// [`${prefixCls}-rtl`]: directionConfig === 'rtl',
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
},
];
if (content.data.class) {
someSpaceClass.push(content.data.class);
}
const itemClassName = `${prefixCls}-item`;
const marginDirection = 'marginRight'; // directionConfig === 'rtl' ? 'marginLeft' : 'marginRight';
return (
<div class={someSpaceClass}>
<div {...content.data} class={someSpaceClass}>
{items.map((child, i) => (
<div
class={itemClassName}