mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 03:46:16 -08:00
27 lines
559 B
JavaScript
27 lines
559 B
JavaScript
import icons from './icons';
|
|
import { append } from './utils';
|
|
|
|
export default class Loading {
|
|
constructor(art) {
|
|
this.art = art;
|
|
this.init();
|
|
}
|
|
|
|
init() {
|
|
const { option, refs: { $loading } } = this.art;
|
|
append($loading, option.loading || icons.loading);
|
|
}
|
|
|
|
hide() {
|
|
const { $loading } = this.art.refs;
|
|
$loading.style.display = 'none';
|
|
this.art.emit('loading:hide', $loading);
|
|
}
|
|
|
|
show() {
|
|
const { $loading } = this.art.refs;
|
|
$loading.style.display = 'flex';
|
|
this.art.emit('loading:show', $loading);
|
|
}
|
|
}
|