tencent.jquery.pix.component 1.0.88-beta1 → 1.0.88-beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/change.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # 更新日志
2
2
 
3
+ ### 1.0.88-beta2
4
+
5
+ - getFontSize每次实时获取
6
+
3
7
  ### 1.0.88-beta1
4
8
 
5
9
  - getFontSize逻辑优化,获取根元素字体大小
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencent.jquery.pix.component",
3
- "version": "1.0.88-beta1",
3
+ "version": "1.0.88-beta2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
package/utils/utils.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { $ } from "../components/config";
2
2
 
3
- let fontSize = -1;
4
3
 
5
4
  // 获取字体大小
6
5
  export const getFontSize = () => {
@@ -8,9 +7,13 @@ export const getFontSize = () => {
8
7
  if (htmlFontSize) {
9
8
  return htmlFontSize;
10
9
  }
10
+ let fontSize = 0;
11
11
  const baseFontSize = 16; // 默认根元素字体大小
12
- if (fontSize === -1) {
13
- fontSize = parseFloat($(document.body).css("font-size").replace('px', ''));
12
+
13
+ fontSize = parseFloat($(document.body).css("font-size").replace('px', ''));
14
+
15
+ if(fontSize){
16
+ return fontSize;
14
17
  }
15
18
 
16
19
  if(!fontSize) {