Browse Source

Fixed auto refresh not clear interval bug

zhixin 4 years ago
parent
commit
93042ac64a
1 changed files with 8 additions and 0 deletions
  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
     }
   }
+
+  destroy () {
+    if (this.options.autoRefresh && this.options.autoRefreshStatus) {
+      clearInterval(this.options.autoRefreshFunction)
+    }
+
+    super.destroy()
+  }
 }