diff --git a/src/address-list/index.tsx b/src/address-list/index.tsx index a5557189f..eb9f7e9cd 100644 --- a/src/address-list/index.tsx +++ b/src/address-list/index.tsx @@ -66,7 +66,9 @@ function AddressList(
{slots.top?.()} {List} - {props.disabledText &&
{props.disabledText}
} + {props.disabledText && ( +
{props.disabledText}
+ )} {DisabledList} {slots.default?.()}
diff --git a/src/cell-group/index.tsx b/src/cell-group/index.tsx index 2cc2d2819..78019a211 100644 --- a/src/cell-group/index.tsx +++ b/src/cell-group/index.tsx @@ -24,7 +24,10 @@ function CellGroup( ctx: RenderContext ) { const Group = ( -
+
{slots.default?.()}
); @@ -32,7 +35,9 @@ function CellGroup( if (props.title || slots.title) { return (
-
{slots.title ? slots.title() : props.title}
+
+ {slots.title ? slots.title() : props.title} +
{Group}
); diff --git a/src/loading/index.tsx b/src/loading/index.tsx index 4af40f4f1..061e16638 100644 --- a/src/loading/index.tsx +++ b/src/loading/index.tsx @@ -33,7 +33,11 @@ function LoadingIcon(h: CreateElement, props: LoadingProps) { ); } -function LoadingText(h: CreateElement, props: LoadingProps, slots: DefaultSlots) { +function LoadingText( + h: CreateElement, + props: LoadingProps, + slots: DefaultSlots +) { if (slots.default) { const style = props.textSize && { fontSize: addUnit(props.textSize), @@ -63,7 +67,10 @@ function Loading( } return ( -
+
{LoadingIcon(h, props)} diff --git a/src/nav-bar/index.tsx b/src/nav-bar/index.tsx index 592f74a4c..6b73bb989 100644 --- a/src/nav-bar/index.tsx +++ b/src/nav-bar/index.tsx @@ -36,36 +36,41 @@ function NavBar( slots: NavBarSlots, ctx: RenderContext ) { + function LeftPart() { + if (slots.left) { + return slots.left(); + } + + return [ + props.leftArrow && , + props.leftText && {props.leftText}, + ]; + } + + function RightPart() { + if (slots.right) { + return slots.right(); + } + + if (props.rightText) { + return {props.rightText}; + } + } + return (
- {slots.left - ? slots.left() - : [ - props.leftArrow && ( - - ), - props.leftText && ( - {props.leftText} - ), - ]} + {LeftPart()}
{slots.title ? slots.title() : props.title}
- {slots.right - ? slots.right() - : props.rightText && ( - {props.rightText} - )} + {RightPart()}
); diff --git a/src/password-input/index.tsx b/src/password-input/index.tsx index 6b755d6c2..8ce64c627 100644 --- a/src/password-input/index.tsx +++ b/src/password-input/index.tsx @@ -39,7 +39,11 @@ function PasswordInput( Points.push(
  • - {props.mask ? : char} + {props.mask ? ( + + ) : ( + char + )} {showCursor &&
    }
  • ); @@ -57,7 +61,9 @@ function PasswordInput( > {Points} - {info &&
    {info}
    } + {info && ( +
    {info}
    + )}
    ); } diff --git a/src/search/index.tsx b/src/search/index.tsx index ccf3135ff..e3cca0847 100644 --- a/src/search/index.tsx +++ b/src/search/index.tsx @@ -43,7 +43,11 @@ function Search( ) { function Label() { if (slots.label || props.label) { - return
    {slots.label ? slots.label() : props.label}
    ; + return ( +
    + {slots.label ? slots.label() : props.label} +
    + ); } } diff --git a/src/skeleton/index.tsx b/src/skeleton/index.tsx index 8ae234fec..eb529662f 100644 --- a/src/skeleton/index.tsx +++ b/src/skeleton/index.tsx @@ -33,7 +33,9 @@ function Skeleton( function Title() { if (props.title) { - return

    ; + return ( +

    + ); } } @@ -54,7 +56,9 @@ function Skeleton( } for (let i = 0; i < props.row; i++) { - Rows.push(
    ); + Rows.push( +
    + ); } return Rows; diff --git a/src/sku/components/SkuHeader.tsx b/src/sku/components/SkuHeader.tsx index cba98856c..fc4524601 100644 --- a/src/sku/components/SkuHeader.tsx +++ b/src/sku/components/SkuHeader.tsx @@ -16,7 +16,10 @@ export type SkuHeaderProps = { const [createComponent, bem] = createNamespace('sku-header'); -function getSkuImg(sku: SkuData, selectedSku: SelectedSkuData): string | undefined { +function getSkuImg( + sku: SkuData, + selectedSku: SelectedSkuData +): string | undefined { let img; sku.tree.some(item => { diff --git a/src/sku/components/SkuRow.tsx b/src/sku/components/SkuRow.tsx index f231e12bb..787d4cab2 100644 --- a/src/sku/components/SkuRow.tsx +++ b/src/sku/components/SkuRow.tsx @@ -24,7 +24,10 @@ function SkuRow( ); return (
    -
    {props.skuRow.k}{multipleNode}
    +
    + {props.skuRow.k} + {multipleNode} +
    {slots.default && slots.default()}
    );