Selaa lähdekoodia

设置焦点优化

ZaiZai 2 vuotta sitten
vanhempi
commit
1ab0d25b66
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      src/plugins/HTableForm.js

+ 4 - 1
src/plugins/HTableForm.js

@@ -246,7 +246,10 @@ export default class HTableForm {
     //设置元素焦点
     static setElementFocus(keyId) {
         if (keyId) {
-            document.getElementById(keyId).focus();
+            try {
+                document.getElementById(keyId).focus();
+            } catch {
+            }
         }
     }
 }