Explorar o código

过滤空白的标签

wolyshaw %!s(int64=2) %!d(string=hai) anos
pai
achega
1591b692d8
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/views/accompaniment/modals/form.vue

+ 4 - 1
src/views/accompaniment/modals/form.vue

@@ -967,7 +967,10 @@ export function getGradualLengthByXml(xml) {
         isLastNoteAndNotClosed = true;
       }
     }
-    const isKeyWork = keys.find(k => k.startsWith(textContent) || textContent?.startsWith(k))
+
+    const isKeyWork = keys.find(k => {
+      return textContent && (k.startsWith(textContent) || textContent?.startsWith(k))
+    })
     if (
       ele.type === "metronome" ||
       (ele.type === "words" && (textContent.startsWith("a tempo") || isKeyWork) || isLastNoteAndNotClosed)