feat(List): add error slot

This commit is contained in:
陈嘉涵
2019-12-26 20:35:16 +08:00
committed by neverland
parent 8a0705d761
commit e9a9388202
5 changed files with 32 additions and 6 deletions
+10 -6
View File
@@ -136,12 +136,16 @@ export default createComponent({
},
genErrorText() {
if (this.error && this.errorText) {
return (
<div onClick={this.clickErrorText} class={bem('error-text')}>
{this.errorText}
</div>
);
if (this.error) {
const text = this.slots('error') || this.errorText;
if (text) {
return (
<div onClick={this.clickErrorText} class={bem('error-text')}>
{text}
</div>
);
}
}
}
},