浏览代码

Fixed font-size of the loading text

zhixin 5 年之前
父节点
当前提交
c0cd6f89e5
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 7 0
      src/bootstrap-table.js
  2. 0 1
      src/themes/_theme.scss

+ 7 - 0
src/bootstrap-table.js

@@ -2695,6 +2695,13 @@ class BootstrapTable {
 
   showLoading () {
     this.$tableLoading.css('display', 'flex')
+
+    let fontSize = this.$tableLoading.width() * 0.04
+
+    fontSize = Math.max(12, fontSize)
+    fontSize = Math.min(32, fontSize)
+
+    this.$tableLoading.find('.loading-text').css('font-size', `${fontSize}px`)
   }
 
   hideLoading () {

+ 0 - 1
src/themes/_theme.scss

@@ -212,7 +212,6 @@
           justify-content: center;
 
           .loading-text {
-            font-size: 2rem;
             margin-right: 6px;
           }