Browse Source

Fix #7353: fix _toggleColumn exception when hideColumn column name not exists

weibangtuo 1 year ago
parent
commit
e1aa3d966b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.js

@@ -2859,7 +2859,7 @@ class BootstrapTable {
   }
 
   _toggleColumn (index, checked, needUpdate) {
-    if (index === -1 || this.columns[index].visible === checked) {
+    if (index === undefined || this.columns[index].visible === checked) {
       return
     }
     this.columns[index].visible = checked