|
@@ -316,6 +316,7 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
const mountEl = document.querySelector("#app")!;
|
|
const mountEl = document.querySelector("#app")!;
|
|
const layer = document.createElement("div");
|
|
const layer = document.createElement("div");
|
|
layer.className = "subtitle";
|
|
layer.className = "subtitle";
|
|
|
|
+ mountEl.appendChild(layer);
|
|
const cleanups = [
|
|
const cleanups = [
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
layer.innerHTML = data.content;
|
|
layer.innerHTML = data.content;
|
|
@@ -336,7 +337,6 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
}),
|
|
}),
|
|
() => mountEl.removeChild(layer),
|
|
() => mountEl.removeChild(layer),
|
|
];
|
|
];
|
|
- mountEl.appendChild(layer);
|
|
|
|
map.subtitles[data.id] = mergeFuns(cleanups);
|
|
map.subtitles[data.id] = mergeFuns(cleanups);
|
|
} else if (!exists && map.subtitles[data.id]) {
|
|
} else if (!exists && map.subtitles[data.id]) {
|
|
map.subtitles[data.id]();
|
|
map.subtitles[data.id]();
|