[improvement] Actionsheet: support use slot and cancel-text at same time (#3021)

This commit is contained in:
neverland
2019-03-20 20:36:42 +08:00
committed by GitHub
parent 2d6269fba8
commit e04322a2e6
3 changed files with 14 additions and 11 deletions
+6 -9
View File
@@ -77,14 +77,6 @@ function Actionsheet(
</div>
);
const Footer = cancelText ? (
<div class={bem('cancel')} onClick={onCancel}>
{cancelText}
</div>
) : (
<div class={bem('content')}>{slots.default && slots.default()}</div>
);
return (
<Popup
class={bem()}
@@ -100,7 +92,12 @@ function Actionsheet(
{...inherit(ctx)}
>
{title ? Header() : props.actions.map(Option)}
{Footer}
{slots.default && <div class={bem('content')}>{slots.default()}</div>}
{cancelText && (
<div class={bem('cancel')} onClick={onCancel}>
{cancelText}
</div>
)}
</Popup>
);
}