liushengqiang há 2 anos atrás
pai
commit
ef4b445826

+ 8 - 1
src/page-instrument/header-top/index.tsx

@@ -1,4 +1,4 @@
-import { Transition, computed, defineComponent, onMounted, onUnmounted, reactive, ref } from "vue";
+import { Transition, computed, defineComponent, onMounted, onUnmounted, reactive, ref, watch } from "vue";
 import styles from "./index.module.less";
 
 import iconBack from "./image/icon-back.svg";
@@ -26,6 +26,7 @@ import TeacherTop from "../custom-plugins/guide-page/teacher-top";
 import StudentTop from "../custom-plugins/guide-page/student-top";
 import { HANDLE_WORK_ADD } from "../custom-plugins/work-index";
 import { browser } from "/src/utils";
+import store from "store";
 
 /** 头部数据和方法 */
 export const headTopData = reactive({
@@ -298,6 +299,12 @@ export default defineComponent({
 			window.removeEventListener("message", changePlay);
 		});
 
+		// 设置改变触发
+		watch(state.setting, () => {
+			console.log(state.setting, "state.setting")
+			store.set("musicscoresetting", state.setting);
+		});
+
 		return () => (
 			<>
 				<div class={[styles.headerTop]}>

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

@@ -18,7 +18,7 @@ import {
 } from "vant";
 import state, { IPlatform } from "/src/state";
 import { api_closeCamera, api_openCamera, api_savePicture } from "/src/helpers/communication";
-import store from "store";
+
 import iconInfo from "../image/info.svg";
 import iconDown from "../image/down.svg";
 import iconTv from "../image/tv.svg";
@@ -79,10 +79,7 @@ export default defineComponent({
 				}
 			}, 500);
 		};
-		// 设置改变触发
-		watch(state.setting, () => {
-			store.set("musicscoresetting", state.setting);
-		});
+		
 		return () => (
 			<div class={styles["header-settting"]}>
 				<div class={styles.content}>