소스 검색

例句变色调整

wangxy 1 개월 전
부모
커밋
405e9b9d35
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      pages/newEnglish/components/xiangjie.vue
  2. 2 1
      pages/newEnglish/components/xuePage.vue

+ 1 - 1
pages/newEnglish/components/xiangjie.vue

@@ -76,7 +76,7 @@
 		const regex = /<([^>]+)>/g;
 		console.log('pageInfo.value.name', pageInfo.value.name);
 		return text.replace(regex, (match) => {
-			return `<span style="color: #3a7fe9;">${word}</span>`;
+			return `<span style="color: #3a7fe9;">${match.replace(/[<>]/g, "")}</span>`;
 		});
 	}
 	const handleBack = () => {

+ 2 - 1
pages/newEnglish/components/xuePage.vue

@@ -137,7 +137,8 @@
 		const word = props.activeWord.name;
 		const regex = /<([^>]+)>/g;
 		return text.replace(regex, (match) => {
-			return `<span style="color: #3a7fe9;">${word}</span>`;
+			console.log('match', match)
+			return `<span style="color: #3a7fe9;">${match.replace(/[<>]/g, "")}</span>`;
 		});
 	}