mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 18:41:20 -08:00
优化icon
This commit is contained in:
1 parent
3861770105
commit
3a545ae5e6
7 files changed
+159
-139
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { append } from '../utils';
|
||||
import { append, def, addClass } from '../utils';
|
||||
import loading from './loading.svg';
|
||||
import state from './state.svg';
|
||||
import play from './play.svg';
|
||||
@@ -30,12 +30,16 @@ export default class Icons {
|
||||
...art.option.icons,
|
||||
};
|
||||
|
||||
Object.keys(icons).forEach(key => {
|
||||
const icon = document.createElement('i');
|
||||
icon.classList.add('art-icon');
|
||||
icon.classList.add(`art-icon-${key}`);
|
||||
append(icon, icons[key]);
|
||||
this[key] = icon;
|
||||
Object.keys(icons).forEach((key) => {
|
||||
def(this, key, {
|
||||
get: () => {
|
||||
const icon = document.createElement('i');
|
||||
addClass(icon, 'art-icon');
|
||||
addClass(icon, `art-icon-${key}`);
|
||||
append(icon, icons[key]);
|
||||
return icon;
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user