Browse Source

修改获取节点为空报错的问题

lex-xin 6 months ago
parent
commit
a353091d5d

+ 0 - 1
components.d.ts

@@ -15,7 +15,6 @@ declare module '@vue/runtime-core' {
     NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
     NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
     NButton: typeof import('naive-ui')['NButton']
-    NCheckbox: typeof import('naive-ui')['NCheckbox']
     NConfigProvider: typeof import('naive-ui')['NConfigProvider']
     NCountdown: typeof import('naive-ui')['NCountdown']
     NDialogProvider: typeof import('naive-ui')['NDialogProvider']

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

@@ -114,8 +114,8 @@ export const onlyVisible = (xml: any, partIndex: any) => {
     }
     Array.from(notes).forEach((note, i) => {
       const graces = note.getElementsByTagName('grace')
-      if (graces && graces.length) {
-        note.appendChild(getNextvNoteDuration(i)?.cloneNode(true))
+      if (graces && graces.length && getNextvNoteDuration(i)) {
+          note?.appendChild(getNextvNoteDuration(i)?.cloneNode(true))
       }
     })
   }