mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-14 16:36:18 -08:00
add layer
This commit is contained in:
1 parent
e4518d21ce
commit
4327787895
15 files changed
+256
-134
No files matched your search
@@ -1,5 +1,16 @@
|
||||
let id = 0;
|
||||
export default class Layers {
|
||||
constructor(art) {
|
||||
this.art = art;
|
||||
}
|
||||
|
||||
add(option) {
|
||||
const { refs } = this.art;
|
||||
id++;
|
||||
refs.$layers.insertAdjacentHTML('beforeend', `
|
||||
<div data-layer-index="${id}" class="art-layer art-layer-${option.name}" style="z-index: ${option.index || id}">
|
||||
${option.html}
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user