浏览代码

Fixed auto refresh not clear interval bug

zhixin 4 年之前
父节点
当前提交
93042ac64a
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/extensions/auto-refresh/bootstrap-table-auto-refresh.js

+ 8 - 0
src/extensions/auto-refresh/bootstrap-table-auto-refresh.js

@@ -77,4 +77,12 @@ $.BootstrapTable = class extends $.BootstrapTable {
       this.options.autoRefreshStatus = !this.options.autoRefreshStatus
       this.options.autoRefreshStatus = !this.options.autoRefreshStatus
     }
     }
   }
   }
+
+  destroy () {
+    if (this.options.autoRefresh && this.options.autoRefreshStatus) {
+      clearInterval(this.options.autoRefreshFunction)
+    }
+
+    super.destroy()
+  }
 }
 }