Pārlūkot izejas kodu

收藏和错题页面的修改

JXDS18FUJT 2 gadi atpakaļ
vecāks
revīzija
7261b43d47
2 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 3 0
      src/api/types/test.d.ts
  2. 1 3
      src/hooks/exercise/wrong.ts

+ 3 - 0
src/api/types/test.d.ts

@@ -1,5 +1,8 @@
 declare namespace Test {
 	interface QuestionInfo {
+		isCollection: boolean;
+		optsBack: any;
+		userAnswer(userAnswer: any): unknown;
 		isTrue?: null|Boolean;
 		answer: string;
 		answerkeyword: string;

+ 1 - 3
src/hooks/exercise/wrong.ts

@@ -125,9 +125,9 @@ export const useSubjectCheck = (currentSubject: ComputedRef<Test.QuestionInfo>,
 					id:currentSubject.value.id,
 					timestamp:+ new Date()
 				})
+				window.localStorage.setItem(userWrongKey,JSON.stringify(userWrongIds))
 			}
 
-
 			// if(userWrongIds.some(item=>{
 			// 	return item.id === currentSubject.value.id
 
@@ -135,8 +135,6 @@ export const useSubjectCheck = (currentSubject: ComputedRef<Test.QuestionInfo>,
 			// else{
 
 			// }
-
-			window.localStorage.setItem(userWrongKey, "[]");
 			//答案错误
 			// wrongModel.adds([
 			// 	{