bge-ui 1.5.0 → 1.5.2

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/dist/index.js CHANGED
@@ -8736,7 +8736,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8736
8736
  const children = DialogBody.value.children;
8737
8737
  for (let i = 0; i < children.length; i++) {
8738
8738
  const child = children[i];
8739
- offsetHeight += child.offsetHeight;
8739
+ const styles = window.getComputedStyle(child);
8740
+ const marginTop = parseFloat(styles.getPropertyValue("margin-top"));
8741
+ const marginBottom = parseFloat(styles.getPropertyValue("margin-bottom"));
8742
+ offsetHeight += child.offsetHeight + marginTop + marginBottom;
8740
8743
  }
8741
8744
  opacity.value = 1;
8742
8745
  height.value = 48 + 64 + 16 + Number(offsetHeight);
@@ -8750,7 +8753,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8750
8753
  const children = DialogBody.value.children;
8751
8754
  for (let i = 0; i < children.length; i++) {
8752
8755
  const child = children[i];
8753
- offsetHeight += child.offsetHeight;
8756
+ const styles = window.getComputedStyle(child);
8757
+ const marginTop = parseFloat(styles.getPropertyValue("margin-top"));
8758
+ const marginBottom = parseFloat(styles.getPropertyValue("margin-bottom"));
8759
+ offsetHeight += child.offsetHeight + marginTop + marginBottom;
8754
8760
  }
8755
8761
  height.value = 48 + 64 + 16 + Number(offsetHeight);
8756
8762
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bge-ui",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -65,7 +65,11 @@ watch(() => [props.visible, props.resetState], ([value]) => {
65
65
  const children = DialogBody.value.children
66
66
  for (let i = 0; i < children.length; i++) {
67
67
  const child = children[i]
68
- offsetHeight += child.offsetHeight
68
+ // 从样式对象中获取顶部和底部的margin值
69
+ const styles = window.getComputedStyle(child)
70
+ const marginTop = parseFloat(styles.getPropertyValue('margin-top'));
71
+ const marginBottom = parseFloat(styles.getPropertyValue('margin-bottom'));
72
+ offsetHeight += child.offsetHeight + marginTop + marginBottom
69
73
  }
70
74
  opacity.value = 1
71
75
  height.value = 48 + 64 + 16 + Number(offsetHeight)
@@ -80,7 +84,11 @@ function updateHeight() {
80
84
  const children = DialogBody.value.children
81
85
  for (let i = 0; i < children.length; i++) {
82
86
  const child = children[i]
83
- offsetHeight += child.offsetHeight
87
+ // 从样式对象中获取顶部和底部的margin值
88
+ const styles = window.getComputedStyle(child)
89
+ const marginTop = parseFloat(styles.getPropertyValue('margin-top'));
90
+ const marginBottom = parseFloat(styles.getPropertyValue('margin-bottom'));
91
+ offsetHeight += child.offsetHeight + marginTop + marginBottom
84
92
  }
85
93
  height.value = 48 + 64 + 16 + Number(offsetHeight)
86
94
  }