add loading

This commit is contained in:
Harvey Zack committed 2018-10-15 17:36:10 +08:00
1 parent e319afd422
commit 7cdf9f69e6
14 files changed
+329 -6

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import Icons from './icons';
export default class Loading {
constructor(art) {
this.art = art;
this.init();
}
init() {
const { option } = this.art;
if (option.loading) {
this.art.refs.$loading.insertAdjacentHTML('beforeend', option.loading);
} else {
this.art.refs.$loading.appendChild(Icons.loading);
}
}
hide() {
this.art.refs.$loading.style.display = 'none';
}
show() {
this.art.refs.$loading.style.display = 'block';
}
}