fix(ShareSheet): title slot not work

This commit is contained in:
chenjiahan
2020-04-09 13:09:32 +08:00
committed by neverland
parent fc4d89b474
commit 1d07aa88ba
7 changed files with 148 additions and 47 deletions
+5 -5
View File
@@ -50,13 +50,13 @@ export default createComponent({
},
genHeader() {
if (!this.title && !this.description) {
return;
}
const title = this.slots('title') || this.title;
const description = this.slots('description') || this.description;
if (!title && !description) {
return;
}
return (
<div class={bem('header')}>
{title && <h2 class={bem('title')}>{title}</h2>}
@@ -76,7 +76,7 @@ export default createComponent({
}}
>
<img src={this.getIconURL(option.icon)} class={bem('icon')} />
<span class={bem('name')}>{option.name || ''}</span>
{option.name && <span class={bem('name')}>{option.name}</span>}
</div>
))}
</div>