fix(NumberKeyboard): show-delete-key prop not work (#5935)

This commit is contained in:
neverland
2020-03-28 09:43:33 +08:00
committed by GitHub
parent cd07773e34
commit ac3c77c17f
6 changed files with 47 additions and 13 deletions
+15 -9
View File
@@ -81,7 +81,11 @@ export default createComponent({
keys.push(
{ text: this.extraKey, theme: ['gray'], type: 'extra' },
{ text: 0 },
{ text: this.deleteText, theme: ['gray'], type: 'delete' }
{
theme: ['gray'],
text: this.showDeleteKey ? this.deleteText : '',
type: this.showDeleteKey ? 'delete' : '',
}
);
break;
case 'custom':
@@ -179,14 +183,16 @@ export default createComponent({
if (this.theme === 'custom') {
return (
<div class={bem('sidebar')}>
<Key
text={this.deleteText}
type="delete"
theme={DELETE_KEY_THEME}
onPress={this.onPress}
>
{this.slots('delete')}
</Key>
{this.showDeleteKey && (
<Key
text={this.deleteText}
type="delete"
theme={DELETE_KEY_THEME}
onPress={this.onPress}
>
{this.slots('delete')}
</Key>
)}
<Key
text={this.closeButtonText}
type="close"