Browse Source

节奏律动时值修改时候 刷新律动

黄琪勇 1 month ago
parent
commit
1354058b93
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/view/rhythm/index.tsx

+ 7 - 1
src/view/rhythm/index.tsx

@@ -1,4 +1,4 @@
-import { computed, defineComponent, onMounted, ref, nextTick } from "vue"
+import { computed, defineComponent, onMounted, ref, watch } from "vue"
 import styles from "./index.module.less"
 import state from "/src/state"
 import { headTopData } from "/src/page-instrument/header-top"
@@ -64,6 +64,12 @@ export default defineComponent({
             return result
          }, [])
       }
+      watch(
+         () => state.times,
+         () => {
+            initRhythmData()
+         }
+      )
       initRhythmData()
       onMounted(() => {
          // 横屏的时候 当宽度大于屏幕的时候缩小一点