mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 14:41:20 -08:00
调整控制器结构
This commit is contained in:
1 parent
cce1eda7eb
commit
a380836d75
21 files changed
+1152
-1422
No files matched your search
@@ -24,6 +24,9 @@ export default function componentMethod(art, parent, target, component, callback
|
||||
const { proxy } = art.events;
|
||||
const option = typeof component === 'function' ? component(art) : component;
|
||||
if (!option.disable) {
|
||||
if (parent.id === undefined) {
|
||||
parent.id = 0;
|
||||
}
|
||||
parent.id += 1;
|
||||
const name = option.name || `${title}${parent.id}`;
|
||||
const $element = document.createElement('div');
|
||||
|
||||
@@ -118,3 +118,14 @@ export function debounce(func, wait, context) {
|
||||
|
||||
return fn;
|
||||
}
|
||||
|
||||
export function show(target, display) {
|
||||
target.classList.remove('art-hide');
|
||||
if (display) {
|
||||
target.style.display = display;
|
||||
}
|
||||
}
|
||||
|
||||
export function hide(target) {
|
||||
target.classList.add('art-hide');
|
||||
}
|
||||
Reference in new issue
Block a user