浏览代码

Fixed Maximum call stack size exceeded error

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

+ 6 - 0
CHANGELOG.md

@@ -1,6 +1,12 @@
 ChangeLog
 ---------
 
+### 1.21.4
+
+#### Core
+
+- **Update:** Fixed Maximum call stack size exceeded error.
+
 ### 1.21.3
 
 #### Core

+ 8 - 5
src/bootstrap-table.js

@@ -3429,14 +3429,17 @@ $.fn.bootstrapTable = function (option, ...args) {
       return
     }
 
+    if (data) {
+      console.warn('You cannot initialize the table more than once!')
+      return
+    }
+
     const options = Utils.extend(true, {}, BootstrapTable.DEFAULTS, $(el).data(),
       typeof option === 'object' && option)
 
-    if (!data) {
-      data = new $.BootstrapTable(el, options)
-      $(el).data('bootstrap.table', data)
-      data.init()
-    }
+    data = new $.BootstrapTable(el, options)
+    $(el).data('bootstrap.table', data)
+    data.init()
   })
 
   return typeof value === 'undefined' ? this : value