fix: improve indentation and formatting for style element creation in plugin

This commit is contained in:
Harvey Zack committed 2025-08-17 18:43:57 +08:00
1 parent 043947c9af
commit 79358663eb
1 file changed
+14 -14
+14 -14
View File
@@ -9,21 +9,21 @@ export default function {{export}}(option) {
}
if (typeof document !== 'undefined') {
const id = 'artplayer-plugin-{{name}}';
let $style = document.getElementById(id)
if (!$style) {
$style = document.createElement('style')
$style.id = id
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
document.head.appendChild($style)
})
}
else {
(document.head || document.documentElement).appendChild($style)
}
const id = 'artplayer-plugin-{{name}}';
let $style = document.getElementById(id)
if (!$style) {
$style = document.createElement('style')
$style.id = id
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => {
document.head.appendChild($style)
})
}
$style.textContent = style
else {
(document.head || document.documentElement).appendChild($style)
}
}
$style.textContent = style
}
if (typeof window !== 'undefined') {