mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
创建组件父类
This commit is contained in:
1 parent
0c1c1273a6
commit
1d859e2049
20 files changed
+770
-921
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user