liushengqiang 1 年之前
父節點
當前提交
622378c9ba
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 8 0
      src/pc/home/index.module.less
  2. 6 0
      src/pc/home/index.tsx

+ 8 - 0
src/pc/home/index.module.less

@@ -7,6 +7,14 @@
     flex-direction: column;
     background-color: #fff;
     overflow: hidden;
+    :global{
+        .abcjs-note{
+            fill: currentColor !important;
+            &.note_selected{
+                fill: #0f81ff !important;
+            }
+        }
+    }
 }
 
 .containerTop {

+ 6 - 0
src/pc/home/index.tsx

@@ -202,8 +202,13 @@ export default defineComponent({
 		const setNoteColor = () => {
 			const gs = document.querySelectorAll(`#paper svg g[fill="#0f81ff"]`);
 			Array.from(gs).forEach((g) => {
+				g.classList.remove("note_selected");
 				g.setAttribute('fill', 'currentColor')
 			})
+			const gs1 = document.querySelectorAll(`#paper svg g.note_selected`);
+			Array.from(gs1).forEach((g) => {
+				g.classList.remove("note_selected");
+			})
 		}
 		/** 点击音符 */
 		const clickListener = (
@@ -226,6 +231,7 @@ export default defineComponent({
 			if (abcElem){
 				if (abcElem.startChar && abcElem.endChar){
 					abcData.visualObj.engraver.rangeHighlight(abcElem.startChar, abcElem.endChar);
+					abcElem?.abselem?.elemset?.[0]?.classList?.add('note_selected')
 				}
 			}