mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
refactor(chapter): PKG-CHAPTER-03 split runtime into typed lifecycle and view modules
This commit is contained in:
1 parent
a0286c4e95
commit
48660c4e12
23 files changed
+1207
-497
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import style from './style.less?inline'
|
||||
|
||||
export function installStyle() {
|
||||
if (typeof document === 'undefined')
|
||||
return
|
||||
|
||||
const id = 'artplayer-plugin-chapter'
|
||||
const install = () => {
|
||||
let element = document.getElementById(id)
|
||||
if (!element) {
|
||||
element = document.createElement('style')
|
||||
element.id = id
|
||||
;(document.head || document.documentElement).appendChild(element)
|
||||
}
|
||||
element.textContent = style
|
||||
}
|
||||
if (document.getElementById(id) || document.readyState !== 'loading')
|
||||
install()
|
||||
else
|
||||
document.addEventListener('DOMContentLoaded', install, { once: true })
|
||||
}
|
||||
Reference in new issue
Block a user