mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
add bar
This commit is contained in:
1 parent
f58684991f
commit
e988f00cf8
15 files changed
+538
-140
No files matched your search
+11
-2
@@ -6,10 +6,19 @@ export default class Events {
|
||||
}
|
||||
|
||||
proxy(target, name, callback, option = {}) {
|
||||
if (Array.isArray(name)) {
|
||||
name.forEach(item => this.proxy(target, item, callback, option));
|
||||
}
|
||||
|
||||
target.addEventListener(name, callback, option);
|
||||
this.destroyEvents.push(() => {
|
||||
|
||||
const destroy = () => {
|
||||
target.removeEventListener(name, callback, option);
|
||||
});
|
||||
};
|
||||
|
||||
this.destroyEvents.push(destroy);
|
||||
|
||||
return destroy;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
Reference in new issue
Block a user