浏览代码

Fixed icons option cannot work when it's string

zhixin 3 年之前
父节点
当前提交
84c09b9720
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/bootstrap-table.js

+ 4 - 4
src/bootstrap-table.js

@@ -43,6 +43,10 @@ class BootstrapTable {
     const iconsPrefix = Utils.getIconsPrefix($.fn.bootstrapTable.theme)
     const icons = Utils.getIcons(iconsPrefix)
 
+    if (typeof opts.icons === 'string') {
+      opts.icons = Utils.calculateObjectValue(null, opts.icons)
+    }
+
     opts.iconsPrefix = opts.iconsPrefix || $.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix
     opts.icons = Object.assign(icons, $.fn.bootstrapTable.defaults.icons, opts.icons)
 
@@ -59,10 +63,6 @@ class BootstrapTable {
     if (typeof this.buttons !== 'object') {
       this.buttons = {}
     }
-
-    if (typeof opts.icons === 'string') {
-      opts.icons = Utils.calculateObjectValue(null, opts.icons)
-    }
   }
 
   initLocale () {