visuddhinanda 2 лет назад
Родитель
Сommit
6a07d52bd8
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      dashboard/src/components/dict/SearchVocabulary.tsx

+ 3 - 2
dashboard/src/components/dict/SearchVocabulary.tsx

@@ -30,8 +30,9 @@ const SearchVocabularyWidget = ({
   const [factors, setFactors] = useState<string[]>([]);
   const intervalRef = useRef<number | null>(null); //防抖计时器句柄
 
+  console.debug("value", value);
   useEffect(() => {
-    console.log("dict input", value);
+    console.debug("dict input", value);
     setInput(value);
     factorChange(value);
   }, [value]);
@@ -72,7 +73,7 @@ const SearchVocabularyWidget = ({
   };
 
   const factorChange = (word?: string) => {
-    if (typeof word === "undefined") {
+    if (typeof word === "undefined" || word.includes(":")) {
       setFactors([]);
       return;
     }