uview-pro 0.5.9 → 0.5.11

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,17 +1,38 @@
1
- ## 0.5.9(2026-02-26
2
-
3
- ### 🐛 Bug Fixes | Bug 修复
4
-
5
- - **calendar:** minDate / maxDate 纳入校验年月范围 ([249c04f](https://github.com/anyup/uView-Pro/commit/249c04f11e8610df4964f2d24d5fbe580e9236f8))
6
-
7
- ### Features | 新功能
8
-
9
- - **calendar:** 日历选择演示页面新增最小/最大日期切换功能 ([dc8aeae](https://github.com/anyup/uView-Pro/commit/dc8aeae5072774d3d1be1318e4f7b4567c9b0385))
10
-
11
- ### 👥 Contributors
12
-
13
- <a href="https://github.com/zakicheung"><img src="https://github.com/zakicheung.png?size=40" width="40" height="40" alt="张淇" title="张淇"/></a> <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
14
-
1
+ ## 0.5.11(2026-03-02)
2
+
3
+ ### 🐛 Bug Fixes | Bug 修复
4
+
5
+ - **u-table:** 修复table文字换行后导致的行高度不一致,边框线错位的问题 ([b6b9c33](https://github.com/anyup/uView-Pro/commit/b6b9c33d41ac3adc6f6a1eb33edd50a355d267bf))
6
+
7
+ ### 👥 Contributors
8
+
9
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
10
+
11
+ ## 0.5.10(2026-02-28)
12
+
13
+ ### 🐛 Bug Fixes | Bug 修复
14
+
15
+ - **useToast:** 修复useToast使用全局弹出时,某场景下弹出失败的问题 ([83b3d7b](https://github.com/anyup/uView-Pro/commit/83b3d7b64995a1801fdf6a33ff2ce0c99ecceaa6))
16
+ - **useModal:** 修复useModal使用全局弹出时,某场景下弹出失败的问题 ([43f98ea](https://github.com/anyup/uView-Pro/commit/43f98ea4adda12e28cd1d906c36279f808b3ea32))
17
+
18
+ ### 👥 Contributors
19
+
20
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
21
+
22
+ ## 0.5.9(2026-02-26)
23
+
24
+ ### 🐛 Bug Fixes | Bug 修复
25
+
26
+ - **calendar:** minDate / maxDate 纳入校验年月范围 ([249c04f](https://github.com/anyup/uView-Pro/commit/249c04f11e8610df4964f2d24d5fbe580e9236f8))
27
+
28
+ ### ✨ Features | 新功能
29
+
30
+ - **calendar:** 日历选择演示页面新增最小/最大日期切换功能 ([dc8aeae](https://github.com/anyup/uView-Pro/commit/dc8aeae5072774d3d1be1318e4f7b4567c9b0385))
31
+
32
+ ### 👥 Contributors
33
+
34
+ <a href="https://github.com/zakicheung"><img src="https://github.com/zakicheung.png?size=40" width="40" height="40" alt="张淇" title="张淇"/></a> <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
35
+
15
36
  ## 0.5.8(2026-02-10)
16
37
 
17
38
  ### 🚀 Chore | 构建/工程依赖/工具
@@ -79,7 +79,8 @@ export default {
79
79
  </script>
80
80
 
81
81
  <script setup lang="ts">
82
- import { ref, computed, watch, onMounted, onBeforeUnmount, useSlots } from 'vue';
82
+ import { ref, computed, watch, useSlots, onMounted, onBeforeUnmount } from 'vue';
83
+ import { onPageHide, onPageShow } from '@dcloudio/uni-app';
83
84
  import { $u } from '../..';
84
85
  import { ModalProps } from './types';
85
86
  import {
@@ -126,7 +127,8 @@ import {
126
127
  const props = defineProps(ModalProps);
127
128
  const emit = defineEmits(['update:modelValue', 'confirm', 'cancel']);
128
129
  const slots = useSlots();
129
-
130
+ // 是否已经初始化事件监听
131
+ const isInit = ref(false);
130
132
  // 确认按钮是否正在加载中
131
133
  const loading = ref(false);
132
134
  const isGlobal = computed(() => !!props.global);
@@ -331,10 +333,10 @@ function resetTempConfig() {
331
333
 
332
334
  // 开始监听事件
333
335
  function startListeners() {
334
- // 如果为全局 toast,则先移除所有事件监听,再重新监听
335
- if (isGlobal.value) {
336
- removeAllListeners();
336
+ if (isInit.value) {
337
+ return;
337
338
  }
339
+ isInit.value = true;
338
340
  if (showEvent.value) {
339
341
  uni?.$on && uni.$on(showEvent.value, onServiceShow);
340
342
  }
@@ -348,6 +350,10 @@ function startListeners() {
348
350
 
349
351
  // 停止监听事件
350
352
  function stopListeners() {
353
+ if (!isInit.value) {
354
+ return;
355
+ }
356
+ isInit.value = false;
351
357
  if (showEvent.value) {
352
358
  uni?.$off && uni.$off(showEvent.value, onServiceShow);
353
359
  }
@@ -372,6 +378,14 @@ function removeAllListeners() {
372
378
  }
373
379
  }
374
380
 
381
+ onPageShow(() => {
382
+ startListeners();
383
+ });
384
+
385
+ onPageHide(() => {
386
+ stopListeners();
387
+ });
388
+
375
389
  onMounted(() => {
376
390
  startListeners();
377
391
  });
@@ -60,6 +60,6 @@ const tdStyle = computed(() => {
60
60
  color: $u-content-color;
61
61
  align-self: stretch;
62
62
  box-sizing: border-box;
63
- height: 100%;
63
+ // height: 100%;
64
64
  }
65
65
  </style>
@@ -48,6 +48,7 @@ export default {
48
48
 
49
49
  <script setup lang="ts">
50
50
  import { ref, computed, onMounted, onBeforeUnmount } from 'vue';
51
+ import { onPageHide, onPageShow } from '@dcloudio/uni-app';
51
52
  import { $u } from '../..';
52
53
  import type { ToastExpose } from './types';
53
54
  import { ToastProps } from './types';
@@ -69,7 +70,8 @@ import {
69
70
  * @example <u-toast ref="uToast" />
70
71
  */
71
72
  const props = defineProps(ToastProps);
72
-
73
+ // 是否已经初始化事件监听
74
+ const isInit = ref(false);
73
75
  // 是否显示toast
74
76
  const isShow = ref(false);
75
77
  // 定时器
@@ -222,10 +224,10 @@ const hideEvent = computed(() =>
222
224
 
223
225
  // 开始监听事件
224
226
  function startListeners() {
225
- // 如果为全局 toast,则先移除所有事件监听,再重新监听
226
- if (isGlobal.value) {
227
- removeAllListeners();
227
+ if (isInit.value) {
228
+ return;
228
229
  }
230
+ isInit.value = true;
229
231
  if (showEvent.value) {
230
232
  uni?.$on && uni.$on(showEvent.value, onServiceShow);
231
233
  }
@@ -236,6 +238,10 @@ function startListeners() {
236
238
 
237
239
  // 停止监听事件
238
240
  function stopListeners() {
241
+ if (!isInit.value) {
242
+ return;
243
+ }
244
+ isInit.value = false;
239
245
  if (showEvent.value) {
240
246
  uni?.$off && uni.$off(showEvent.value, onServiceShow);
241
247
  }
@@ -254,6 +260,14 @@ function removeAllListeners() {
254
260
  }
255
261
  }
256
262
 
263
+ onPageShow(() => {
264
+ startListeners();
265
+ });
266
+
267
+ onPageHide(() => {
268
+ stopListeners();
269
+ });
270
+
257
271
  onMounted(() => {
258
272
  startListeners();
259
273
  });
@@ -6,10 +6,6 @@ u-th {
6
6
  align-self: stretch;
7
7
  }
8
8
 
9
- .u-td {
10
- height: 100%;
11
- }
12
-
13
9
  u-icon {
14
10
  display: inline-flex;
15
11
  align-items: center;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-pro",
3
3
  "name": "uview-pro",
4
4
  "displayName": "【支持鸿蒙】uView Pro|基于Vue3+TS的高质量UI组件库,支持多主题、暗黑模式、多语言",
5
- "version": "0.5.9",
5
+ "version": "0.5.11",
6
6
  "description": "uView Pro是基于Vue3+TS的多平台UI框架,提供80+高质量组件、便捷工具和常用模板,支持多主题、暗黑模式、多语言,支持H5/APP/鸿蒙/小程序多端开发。已在鸿蒙应用商店上架,欢迎体验!",
7
7
  "main": "index.ts",
8
8
  "module": "index.ts",