uview-plus 3.5.22 → 3.5.25

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/changelog.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 3.5.25(2025-08-28)
2
+ fix: 修复左侧与右侧弹出时页面打开闪现问题
3
+
4
+ ## 3.5.24(2025-08-28)
5
+ feat: 优化tooltip弹窗定位
6
+
7
+ feat: tooltip组件新增forcePosition支持强制精确定位
8
+
9
+ ## 3.5.23(2025-08-28)
10
+ improvment: 调整pdf阅读器默认高度
11
+
1
12
  ## 3.5.22(2025-08-28)
2
13
  feat: 新增goods-sku商品SKU选购组件
3
14
 
@@ -8,7 +8,7 @@ export default {
8
8
  // 组件高度
9
9
  height: {
10
10
  type: String,
11
- default: '700px'
11
+ default: '500px'
12
12
  },
13
13
  // pdfjs资源域名
14
14
  baseUrl: {
@@ -67,5 +67,10 @@ export const props = defineMixin({
67
67
  type: String,
68
68
  default: () => defProps.tooltip.triggerMode
69
69
  },
70
+ // 强制定位
71
+ forcePosition: {
72
+ type: Object,
73
+ default: () => defProps.tooltip.forcePosition
74
+ }
70
75
  }
71
76
  })
@@ -22,6 +22,7 @@ export default {
22
22
  overlay: true,
23
23
  showToast: true,
24
24
  popupBgColor: '',
25
- triggerMode: 'longpress'
25
+ triggerMode: 'longpress',
26
+ forcePosition: {}
26
27
  }
27
28
  }
@@ -29,9 +29,9 @@
29
29
  duration="300"
30
30
  :customStyle="{
31
31
  position: 'absolute',
32
- top: addUnit(tooltipTop),
32
+ top: addUnit(tooltipTop, 'px'),
33
33
  zIndex: zIndex,
34
- ...tooltipStyle
34
+ ...tooltipStyleCpu
35
35
  }"
36
36
  >
37
37
  <view
@@ -155,13 +155,14 @@
155
155
  screenGap: 12,
156
156
  // 三角形指示器的宽高,由于对元素进行了角度旋转,精确计算指示器位置时,需要用到其尺寸信息
157
157
  indicatorWidth: 14,
158
- tooltipStyle: {}
158
+ tooltipStyle: {},
159
+ calcReacted: false
159
160
  }
160
161
  },
161
162
  watch: {
162
163
  async propsChange() {
163
164
  await this.getElRect()
164
- this.getTooltipStyle();
165
+ // this.getTooltipStyle();
165
166
  }
166
167
  },
167
168
  computed: {
@@ -169,28 +170,19 @@
169
170
  // 当一些依赖参数变化时,需要重新计算气泡和指示器的位置信息
170
171
  propsChange() {
171
172
  return [this.text, this.buttons]
172
- }
173
- },
174
- mounted() {
175
- this.init()
176
- },
177
- emits: ["click"],
178
- methods: {
179
- addStyle,
180
- addUnit,
181
- async init() {
182
- await this.getElRect()
183
- this.getTooltipStyle();
184
173
  },
185
174
  // 计算气泡和指示器的位置信息
186
- getTooltipStyle() {
175
+ tooltipStyleCpu() {
176
+ if (!this.calcReacted) {
177
+ return {}
178
+ }
187
179
  const style = {},
188
180
  sysInfo = getWindowInfo()
189
181
  if (this.direction === 'left') {
190
182
  // 右侧显示逻辑
191
183
  style.transform = ``
192
184
  // 垂直居中对齐
193
- style.top = '-' + addUnit((this.tooltipInfo.height - this.indicatorWidth) / 2, 'px')
185
+ style.top = '-' + addUnit((this.textInfo.height - this.tooltipInfo.height) / 2, 'px')
194
186
  style.right = addUnit(this.textInfo.width + this.indicatorWidth, 'px')
195
187
  this.indicatorStyle = {}
196
188
  this.indicatorStyle.right = '-4px'
@@ -199,7 +191,7 @@
199
191
  // 右侧显示逻辑
200
192
  style.transform = ``
201
193
  // 垂直居中对齐
202
- style.top = addUnit((this.textInfo.height - this.tooltipInfo.height) / 2, 'px')
194
+ style.top = '-' + addUnit((this.textInfo.height - this.tooltipInfo.height) / 2, 'px')
203
195
  style.left = addUnit(this.textInfo.width + this.indicatorWidth, 'px')
204
196
  this.indicatorStyle = {}
205
197
  this.indicatorStyle.left = '-4px'
@@ -230,8 +222,21 @@
230
222
  this.indicatorStyle.top = '-4px'
231
223
  }
232
224
  }
233
- this.tooltipStyle = style
234
- return style
225
+ let styleMerge = {...style, ...this.forcePosition}
226
+ this.tooltipStyle = styleMerge
227
+ return styleMerge
228
+ }
229
+ },
230
+ mounted() {
231
+ this.init()
232
+ },
233
+ emits: ["click"],
234
+ methods: {
235
+ addStyle,
236
+ addUnit,
237
+ async init() {
238
+ await this.getElRect()
239
+ // this.getTooltipStyle();
235
240
  },
236
241
  // 点击触发事件
237
242
  async clickHander() {
@@ -292,6 +297,9 @@
292
297
  // 获取气泡尺寸之后,将其隐藏,为了让下次切换气泡显示与隐藏时,有淡入淡出的效果
293
298
  this.showTooltip = false
294
299
  this.textInfo = await this.queryRect(this.textId)
300
+ sleep(500).then(() => {
301
+ this.calcReacted = true
302
+ })
295
303
  resolve()
296
304
  })
297
305
  })
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙跨端移动组件库,组件丰富维护更新稳定。",
5
- "version": "3.5.22",
5
+ "version": "3.5.25",
6
6
  "description": "零云®uview-plus已兼容vue3支持多语言,100+全面的组件和便捷的工具会让您信手拈来。近期新增拖动排序、条码、图片裁剪、下拉刷新、虚拟列表、签名、Markdown等。",
7
7
  "keywords": [
8
8
  "uview",