feat(ShareSheet): support title、description prop

This commit is contained in:
chenjiahan
2020-04-09 13:09:32 +08:00
committed by neverland
parent 5080761cfe
commit 68164e64cf
7 changed files with 150 additions and 14 deletions
+17
View File
@@ -48,6 +48,22 @@ export default createComponent({
return icon;
},
genHeader() {
if (!this.title && !this.description) {
return;
}
const title = this.slots('title') || this.title;
const description = this.slots('description') || this.description;
return (
<div class={bem('header')}>
{title && <h2 class={bem('title')}>{title}</h2>}
{description && <span class={bem('description')}>{description}</span>}
</div>
);
},
genOptions() {
return (
<div class={bem('options')}>
@@ -89,6 +105,7 @@ export default createComponent({
safeAreaInsetBottom={this.safeAreaInsetBottom}
onInput={this.toggle}
>
{this.genHeader()}
{this.genOptions()}
{this.genCancelText()}
</Popup>