feat(NumberKeyboard): add collapse icon (#6152)

This commit is contained in:
neverland
2020-04-27 22:54:53 +08:00
committed by GitHub
parent 8aced05260
commit b99349ec94
9 changed files with 82 additions and 42 deletions
+6
View File
@@ -1,6 +1,7 @@
import { createNamespace } from '../utils';
import { TouchMixin } from '../mixins/touch';
import DeleteIcon from './DeleteIcon';
import CollapseIcon from './CollapseIcon';
const [createComponent, bem] = createNamespace('key');
@@ -50,6 +51,7 @@ export default createComponent({
},
genContent() {
const isExtra = this.type === 'extra';
const isDelete = this.type === 'delete';
const text = this.slots('default') || this.text;
@@ -57,6 +59,10 @@ export default createComponent({
return text || <DeleteIcon class={bem('delete-icon')} />;
}
if (isExtra) {
return text || <CollapseIcon class={bem('collapse-icon')} />;
}
return text;
},
},