feat(NumberKeyboard): add close-button-loading prop (#6158)

This commit is contained in:
neverland
2020-04-28 11:51:13 +08:00
committed by GitHub
parent acfefe6518
commit 3e9863d63a
6 changed files with 30 additions and 4 deletions
+6
View File
@@ -1,5 +1,6 @@
import { createNamespace } from '../utils';
import { TouchMixin } from '../mixins/touch';
import Loading from '../loading';
import DeleteIcon from './DeleteIcon';
import CollapseIcon from './CollapseIcon';
@@ -14,6 +15,7 @@ export default createComponent({
color: String,
wider: Boolean,
large: Boolean,
loading: Boolean,
},
data() {
@@ -55,6 +57,10 @@ export default createComponent({
const isDelete = this.type === 'delete';
const text = this.slots('default') || this.text;
if (this.loading) {
return <Loading class={bem('loading-icon')} />;
}
if (isDelete) {
return text || <DeleteIcon class={bem('delete-icon')} />;
}