浏览代码

Merge pull request #7584 from wenzhixin/fix/7581

Fixed data field attr not working bug
文翼 1 年之前
父节点
当前提交
79b9377089
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      src/bootstrap-table.js

+ 5 - 5
src/bootstrap-table.js

@@ -1585,16 +1585,16 @@ class BootstrapTable {
       }
 
       // handle class, style, id, rowspan, colspan and title of td
-      for (const item of ['class', 'style', 'id', 'rowspan', 'colspan', 'title']) {
-        const value = item[`_${field}_${item}`]
+      for (const attr of ['class', 'style', 'id', 'rowspan', 'colspan', 'title']) {
+        const value = item[`_${field}_${attr}`]
 
         if (!value) {
           continue
         }
-        if (attrs[item]) {
-          attrs[item].push(value)
+        if (attrs[attr]) {
+          attrs[attr].push(value)
         } else {
-          attrs[item] = value
+          attrs[attr] = value
         }
       }