mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 19:51:20 -08:00
优化组件id
This commit is contained in:
1 parent
39ea75450c
commit
8ee7488bb1
7 files changed
+17
-9
No files matched your search
@@ -3,7 +3,6 @@ import { append, insertByIndex, setStyles, setStyle, remove } from './index';
|
||||
export default function component(art, parent, target, getOption, callback, title) {
|
||||
const option = typeof getOption === 'function' ? getOption(art) : getOption;
|
||||
if (!option.disable) {
|
||||
parent.id += 1;
|
||||
const name = option.name || `${title}${parent.id}`;
|
||||
const $element = document.createElement('div');
|
||||
$element.classList.value = `art-${title} art-${title}-${name}`;
|
||||
@@ -35,6 +34,7 @@ export default function component(art, parent, target, getOption, callback, titl
|
||||
}
|
||||
|
||||
parent[name] = {
|
||||
id: parent.id,
|
||||
$ref: $element,
|
||||
hide() {
|
||||
setStyle($element, 'display', 'none');
|
||||
|
||||
Reference in new issue
Block a user