提取共用方法

This commit is contained in:
Harvey committed 2019-11-14 10:11:03 +08:00
1 parent 48ade99047
commit 7a84c262da
45 files changed
+242 -257

No files matched your search

+3 -3
View File
@@ -1,4 +1,4 @@
import { append } from './utils';
import { append, addClass, removeClass } from './utils';
export default class Loading {
constructor(art) {
@@ -11,11 +11,11 @@ export default class Loading {
const { $player } = this.art.template;
if (value) {
this.state = true;
$player.classList.add('artplayer-loading-show');
addClass($player, 'artplayer-loading-show');
this.art.emit('loading:show');
} else {
this.state = false;
$player.classList.remove('artplayer-loading-show');
removeClass($player, 'artplayer-loading-show');
this.art.emit('loading:hide');
}
}