ソースを参照

Fixed insertRow not write to source data array bug with empty data initialized (#4906)

文翼 5 年 前
コミット
9009c36070
1 ファイル変更3 行追加2 行削除
  1. 3 2
      src/bootstrap-table.js

+ 3 - 2
src/bootstrap-table.js

@@ -184,8 +184,9 @@ class BootstrapTable {
 
     // if options.data is setting, do not process tbody and tfoot data
     if (!this.options.data.length) {
-      this.options.data = Utils.trToData(this.columns, this.$el.find('>tbody>tr'))
-      if (this.options.data.length) {
+      const htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'))
+      if (htmlData.length) {
+        this.options.data = htmlData
         this.fromHtml = true
       }
     }