bill 4 months ago
parent
commit
7974c03578
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/sdk/association/animation.ts

+ 1 - 1
src/sdk/association/animation.ts

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