创建组件父类

This commit is contained in:
Harvey committed 2019-11-22 15:35:21 +08:00
1 parent 0c1c1273a6
commit 1d859e2049
20 files changed
+770 -921

No files matched your search

+4 -20
View File
@@ -1,26 +1,10 @@
import { append, addClass, removeClass } from './utils';
import { append } from './utils';
import Component from './utils/components';
export default class Loading {
export default class Loading extends Component {
constructor(art) {
this.art = art;
super(art);
const { $loading } = art.template;
append($loading, art.icons.loading);
}
set show(value) {
const { $player } = this.art.template;
if (value) {
this.state = true;
addClass($player, 'art-loading-show');
this.art.emit('loading:show');
} else {
this.state = false;
removeClass($player, 'art-loading-show');
this.art.emit('loading:hide');
}
}
toggle() {
this.show = !this.state;
}
}