lex-xin 10 miesięcy temu
rodzic
commit
32355e92ea

+ 2 - 2
src/views/music-library/music-sheet/modal/music-operationV2.tsx

@@ -277,7 +277,7 @@ export const getXmlInfo = (xml: string): FormatXMLInfo => {
   const measures = xmlParse.getElementsByTagName('measure')
 
   for (const item of Array.from(xmlParse.getElementsByTagName('part-name'))) {
-    if (item.textContent) {
+    if (item.textContent?.trim()) {
       data.partNames.push(item.textContent)
     }
   }
@@ -975,7 +975,7 @@ export default defineComponent({
           }
         } else {
           // 优先解析声轨,没有就取id值
-          if (part) {
+          if (part && part.textContent?.trim()) {
             track = part.textContent || ''
           } else {
             let id = item.getAttribute('id')