浏览代码

Fix #4098: Fixed IE11 transform bug

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

+ 5 - 0
.babelrc

@@ -5,6 +5,11 @@
     }],
     "stage-0",
   ],
+  "plugins": [
+    "array-includes",
+    ["transform-es2015-for-of", {"loose": true}],
+    "object-entries-and-values-to-object-keys"
+  ],
   "env": {
     "production": {
       "presets": ["babili"]

+ 3 - 0
package.json

@@ -8,6 +8,9 @@
   },
   "devDependencies": {
     "babel-cli": "^6.26.0",
+    "babel-plugin-array-includes": "^2.0.3",
+    "babel-plugin-object-entries-and-values-to-object-keys": "^1.0.1",
+    "babel-plugin-transform-es2015-for-of": "^6.23.0",
     "babel-preset-babili": "^0.1.4",
     "babel-preset-env": "^1.7.0",
     "babel-preset-stage-0": "^6.24.1",

+ 2 - 2
src/bootstrap-table.js

@@ -259,9 +259,9 @@
     },
 
     findIndex (items, item) {
-      for (const [i, it] of items.entries()) {
+      for (const it of items) {
         if (JSON.stringify(it) === JSON.stringify(item)) {
-          return i
+          return items.indexOf(it)
         }
       }
       return -1