Forráskód Böngészése

优化 切换铺面和转普的 执行顺序。切换过程中元素不位移

黄琪勇 11 hónapja
szülő
commit
9354ca0b15

+ 2 - 2
src/page-instrument/header-top/settting/index.tsx

@@ -213,9 +213,9 @@ export default defineComponent({
                                                     return
                                                 }
                                                 headTopData.settingMode = false
-                                                state.isSingleLine = item.value 
                                                 // resetRenderMusicScore(state.musicRenderType)
                                                 const _time = setTimeout(() => {
+                                                    state.isSingleLine = item.value 
                                                     clearTimeout(_time)
                                                     refreshMusicSvg();
                                                 }, 100);
@@ -238,9 +238,9 @@ export default defineComponent({
                                                     return
                                                 }
                                                 headTopData.settingMode = false
-                                                state.musicRenderType = item.value as any
                                                 // resetRenderMusicScore(state.musicRenderType)
                                                 const _time = setTimeout(() => {
+                                                    state.musicRenderType = item.value as any
                                                     clearTimeout(_time)
                                                     refreshMusicSvg();
                                                 }, 100);

+ 5 - 4
src/view/music-score/index.tsx

@@ -210,10 +210,11 @@ export default defineComponent({
 		const refreshMusicScore = async () => {
 			console.log('刷新谱面123')
 			isLoadingCss.value = true
-			const container = document.getElementById('musicAndSelection'), svgDom = document.getElementById('osmdCanvasPage1'), selectionBox = document.getElementById('selectionBox');
-			if (container && svgDom) {
-				container?.removeChild(svgDom)
-				container?.removeChild(selectionBox)
+			const container = document.getElementById('musicAndSelection'), svgDom = document.getElementById('osmdCanvasPage1'), selectionBox = document.getElementById('selectionBox'), selectionBgBox = document.getElementById('selectionBgBox');
+			if (container) {
+				svgDom && container?.removeChild(svgDom)
+				selectionBox && container?.removeChild(selectionBox)
+				selectionBgBox && container?.removeChild(selectionBgBox)
 			}
 			state.vfmeasures = [];
 			musicData.showSelection = false;