Browse Source

fix #2621: Fixed data-* attribute is an object bug

zhixin 6 years ago
parent
commit
c1d834e502
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.js

@@ -1807,7 +1807,7 @@
           if (k === 'index') {
             return
           }
-          data_ += ` data-${k}="${v}"`
+          data_ += ` data-${k}='${typeof v === 'object' ? JSON.stringify(v) : v}'`
         }
       }