浏览代码

Fixed toggle all columns error when column switchable is false.

zhixin 3 年之前
父节点
当前提交
f93177d52a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/bootstrap-table.js

+ 5 - 1
src/bootstrap-table.js

@@ -2796,7 +2796,11 @@ class BootstrapTable {
   _toggleAllColumns (visible) {
     for (const column of this.columns.slice().reverse()) {
       if (column.switchable) {
-        if (!visible && this.options.showColumns && this.getVisibleColumns().length === this.options.minimumCountColumns) {
+        if (
+          !visible &&
+          this.options.showColumns &&
+          this.getVisibleColumns().filter(it => it.switchable).length === this.options.minimumCountColumns
+        ) {
           continue
         }
         column.visible = visible