mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
refactor(core): CORE-04 scope initialization and make destruction reentrant-safe
This commit is contained in:
1 parent
3e38dd0d19
commit
4eec8112fa
32 files changed
+2779
-189
No files matched your search
@@ -1,9 +1,11 @@
|
||||
import { getScope } from './lifecycle/instance'
|
||||
import { addClass, removeClass } from './utils'
|
||||
|
||||
export default class Notice {
|
||||
constructor(art) {
|
||||
this.art = art
|
||||
this.timer = null
|
||||
getScope(art).add(() => this.destroy())
|
||||
|
||||
art.on('destroy', () => this.destroy())
|
||||
}
|
||||
@@ -16,6 +18,8 @@ export default class Notice {
|
||||
}
|
||||
|
||||
set show(msg) {
|
||||
if (getScope(this.art).closed)
|
||||
return
|
||||
const {
|
||||
constructor,
|
||||
template: { $player, $noticeInner },
|
||||
|
||||
Reference in new issue
Block a user