mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 10:31:20 -08:00
refactor(core): CORE-13 type component registries and own control lifetimes
This commit is contained in:
1 parent
9eb7c945ca
commit
697817eceb
68 files changed
+10100
-1925
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import type { ComponentHost, EntryInput } from './component/types'
|
||||
import Component from './utils/component'
|
||||
|
||||
export interface LayerHost extends ComponentHost {
|
||||
option: { layers: EntryInput<LayerHost>[] }
|
||||
template: { $player: HTMLElement, $layer: HTMLElement }
|
||||
}
|
||||
|
||||
export default class Layer extends Component<LayerHost> {
|
||||
constructor(art: LayerHost) {
|
||||
super(art)
|
||||
const { option, template: { $layer } } = art
|
||||
this.name = 'layer'
|
||||
this.$parent = $layer
|
||||
for (let index = 0; index < option.layers.length; index++)
|
||||
this.add(option.layers[index]!)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user