This commit is contained in:
Harvey Zack committed 2018-10-15 17:51:17 +08:00
1 parent 7cdf9f69e6
commit 32e93bb875
9 files changed
+23 -15

No files matched your search

+6 -3
View File
@@ -3,23 +3,26 @@ import Icons from './icons';
export default class Loading {
constructor(art) {
this.art = art;
this.state = false;
this.init();
}
init() {
const { option } = this.art;
const { option, refs: { $loading } } = this.art;
if (option.loading) {
this.art.refs.$loading.insertAdjacentHTML('beforeend', option.loading);
$loading.insertAdjacentHTML('beforeend', option.loading);
} else {
this.art.refs.$loading.appendChild(Icons.loading);
$loading.appendChild(Icons.loading);
}
}
hide() {
this.state = false;
this.art.refs.$loading.style.display = 'none';
}
show() {
this.state = true;
this.art.refs.$loading.style.display = 'block';
}
}