mzx16822 6 年 前
コミット
b42f341f36
共有1 個のファイルを変更した2 個の追加2 個の削除を含む
  1. 2 2
      public/plugins/layui/tvSysBtnBind.v2.js

+ 2 - 2
public/plugins/layui/tvSysBtnBind.v2.js

@@ -446,12 +446,12 @@ function fireKeyEvent(el, evtType, keyCode) {
                     _this.currentIndex = _this.currentIndex;
                     _this.className = _this.className;
                     
-                    if((typeof init.rules[_this.className]["onPress"]) == "function")
+                    if(init.rules[_this.className]&&(typeof init.rules[_this.className]["onPress"]) == "function")
                     init.rules[_this.className]["onPress"].call(_this);
                     else _this.onPress.call(_this);
                     if (e.keyCode == btnEnter){
                         
-                        if((typeof init.rules[_this.className]["onEnterPress"]) == "function")
+                        if(init.rules[_this.className]&&(typeof init.rules[_this.className]["onEnterPress"]) == "function")
                         init.rules[_this.className]["onEnterPress"].call(_this);
                         else _this.onEnterPress.call(_this);
                     }