uview-pro 0.6.19 → 0.6.21
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 +22 -0
- package/components/u-count-down/u-count-down.vue +15 -2
- package/components/u-divider/types.ts +3 -1
- package/components/u-divider/u-divider.vue +3 -0
- package/components/u-input/u-input.vue +1 -1
- package/components/u-tabs-swiper/u-tabs-swiper.vue +7 -0
- package/components/u-time-line-item/types.ts +1 -1
- package/components/u-time-line-item/u-time-line-item.vue +1 -1
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## 0.6.21(2026-10-10)
|
|
2
|
+
|
|
3
|
+
### ✨ Features | 新功能
|
|
4
|
+
|
|
5
|
+
- **divider:** 新增 dashed 属性支持虚线 ([240432b](https://github.com/anyup/uView-Pro/commit/240432bc774f4b4d2cd64297de1762a1ea94d2bd))
|
|
6
|
+
|
|
7
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
8
|
+
|
|
9
|
+
- **u-tabs-swiper:** 修复 setDx 在 tabsInfo 未初始化时访问 undefined 导致报错 ([a581f97](https://github.com/anyup/uView-Pro/commit/a581f972bc6569557b765f8ed15c65d1bb254fda))
|
|
10
|
+
|
|
11
|
+
## 0.6.20(2026-09-20)
|
|
12
|
+
|
|
13
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
14
|
+
|
|
15
|
+
- **u-time-line:** 修改节点默认背景色为透明 ([be7a591](https://github.com/anyup/uView-Pro/commit/be7a591b6357dc55739487d78334cae896d976bc))
|
|
16
|
+
- **u-input:** 圆角与边框解耦,不传border时同样有圆角 ([2bfb23e](https://github.com/anyup/uView-Pro/commit/2bfb23eb048328ee218efc8e3d3b556111872b54))
|
|
17
|
+
- **u-count-down:** 修复组件卸载后定时器残留泄漏问题,另新增destroy暴露方法用于主动停止倒计时并清理定时器 ([ad596c4](https://github.com/anyup/uView-Pro/commit/ad596c43db06be8853606d8ac5e6f4f66768c055))
|
|
18
|
+
|
|
19
|
+
### 👥 Contributors
|
|
20
|
+
|
|
21
|
+
<a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
|
|
22
|
+
|
|
1
23
|
## 0.6.19(2026-09-07)
|
|
2
24
|
|
|
3
25
|
### ✨ Features | 新功能
|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
81
81
|
</script>
|
|
82
82
|
|
|
83
83
|
<script setup lang="ts">
|
|
84
|
-
import { ref, computed, watch, onMounted } from 'vue';
|
|
84
|
+
import { ref, computed, watch, onMounted, onUnmounted } from 'vue';
|
|
85
85
|
import { CountDownProps } from './types';
|
|
86
86
|
import { $u, useLocale } from '../../';
|
|
87
87
|
|
|
@@ -170,6 +170,11 @@ onMounted(() => {
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
|
|
173
|
+
// 组件销毁时清理定时器,避免定时器残留造成泄漏
|
|
174
|
+
onUnmounted(() => {
|
|
175
|
+
clearTimer();
|
|
176
|
+
});
|
|
177
|
+
|
|
173
178
|
/**
|
|
174
179
|
* 倒计时
|
|
175
180
|
*/
|
|
@@ -240,9 +245,17 @@ function clearTimer() {
|
|
|
240
245
|
}
|
|
241
246
|
}
|
|
242
247
|
|
|
248
|
+
/**
|
|
249
|
+
* 销毁倒计时:清除定时器且不触发 end 事件,用于主动销毁/停止倒计时
|
|
250
|
+
*/
|
|
251
|
+
function destroy() {
|
|
252
|
+
clearTimer();
|
|
253
|
+
}
|
|
254
|
+
|
|
243
255
|
defineExpose({
|
|
244
256
|
start,
|
|
245
|
-
end
|
|
257
|
+
end,
|
|
258
|
+
destroy
|
|
246
259
|
});
|
|
247
260
|
</script>
|
|
248
261
|
|
|
@@ -35,7 +35,9 @@ export const DividerProps = {
|
|
|
35
35
|
/** 下边距 */
|
|
36
36
|
marginBottom: { type: [String, Number] as PropType<string | number>, default: 0 },
|
|
37
37
|
/** 是否使用slot传入内容,如果不用slot传入内容,先的中间就不会有空隙 */
|
|
38
|
-
useSlot: { type: Boolean, default: true }
|
|
38
|
+
useSlot: { type: Boolean, default: true },
|
|
39
|
+
/** 是否虚线 */
|
|
40
|
+
dashed: { type: Boolean, default: false }
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
export type DividerProps = ExtractPropTypes<typeof DividerProps>;
|
|
@@ -68,6 +68,7 @@ import { $u } from '../../';
|
|
|
68
68
|
* @property {String Number} height 整个divider的高度,单位rpx(默认40)
|
|
69
69
|
* @property {String} type 将线条设置主题色(默认primary)
|
|
70
70
|
* @property {Boolean} useSlot 是否使用slot传入内容,如果不传入,中间不会有空隙(默认true)
|
|
71
|
+
* @property {Boolean} dashed 是否虚线(默认false)
|
|
71
72
|
* @property {String Number} margin-top 与前一个组件的距离,单位rpx(默认0)
|
|
72
73
|
* @property {String Number} margin-bottom 与后一个组件的距离,单位rpx(0)
|
|
73
74
|
* @event {Function} click divider组件被点击时触发
|
|
@@ -86,6 +87,8 @@ const lineStyle = computed(() => {
|
|
|
86
87
|
else style.width = props.halfWidth + 'rpx';
|
|
87
88
|
// borderColor优先级高于type值
|
|
88
89
|
if (props.borderColor) style.borderColor = props.borderColor;
|
|
90
|
+
// 虚线
|
|
91
|
+
if (props.dashed) style.borderStyle = 'dashed';
|
|
89
92
|
return style;
|
|
90
93
|
});
|
|
91
94
|
|
|
@@ -361,6 +361,7 @@ defineExpose({
|
|
|
361
361
|
flex: 1;
|
|
362
362
|
@include vue-flex;
|
|
363
363
|
align-items: center;
|
|
364
|
+
border-radius: 4px;
|
|
364
365
|
|
|
365
366
|
&__readonly-overlay {
|
|
366
367
|
position: absolute;
|
|
@@ -410,7 +411,6 @@ defineExpose({
|
|
|
410
411
|
}
|
|
411
412
|
|
|
412
413
|
&--border {
|
|
413
|
-
border-radius: 4px;
|
|
414
414
|
border: 1px solid $u-border-color;
|
|
415
415
|
}
|
|
416
416
|
|
|
@@ -228,6 +228,11 @@ function getQuery(cb?: (data: any) => void) {
|
|
|
228
228
|
|
|
229
229
|
// 颜色渐变tab滑动
|
|
230
230
|
function setDx(dx: number) {
|
|
231
|
+
// 防止 tabsInfo 尚未初始化完成时访问未定义元素导致的报错:
|
|
232
|
+
// init() 中 getTabsInfo() 为异步(依赖 SelectorQuery 回调填充 tabsInfo),
|
|
233
|
+
// 若 swiper 的 transition 事件早于节点查询完成触发,tabsInfo 仍为空数组,
|
|
234
|
+
// 此时直接读取 tabsInfo.value[index].left 会抛出 "Cannot read property 'left' of undefined"
|
|
235
|
+
if (tabsInfo.value.length === 0) return;
|
|
231
236
|
let nextTabIndex = dx > 0 ? animationFinishCurrent.value + 1 : animationFinishCurrent.value - 1;
|
|
232
237
|
// 判断索引是否超出边界
|
|
233
238
|
nextTabIndex = nextTabIndex <= 0 ? 0 : nextTabIndex;
|
|
@@ -235,6 +240,8 @@ function setDx(dx: number) {
|
|
|
235
240
|
const tab = tabsInfo.value[nextTabIndex];
|
|
236
241
|
// 当前tab中心点x轴坐标
|
|
237
242
|
const nowTab = tabsInfo.value[animationFinishCurrent.value];
|
|
243
|
+
// 若当前或目标 tab 的节点信息尚未获取到,跳过本次渐变计算,等待下一次 transition 事件
|
|
244
|
+
if (!tab || !nowTab) return;
|
|
238
245
|
const nowTabX = nowTab.left + nowTab.width / 2;
|
|
239
246
|
// 下一个tab
|
|
240
247
|
const nextTabX = tab.left + tab.width / 2;
|
|
@@ -16,7 +16,7 @@ export const TimeLineItemProps = {
|
|
|
16
16
|
default: ''
|
|
17
17
|
},
|
|
18
18
|
/** 节点的背景颜色 */
|
|
19
|
-
bgColor: { type: String, default: '
|
|
19
|
+
bgColor: { type: String, default: 'transparent' },
|
|
20
20
|
/** 节点左边图标绝对定位的top值,单位rpx */
|
|
21
21
|
nodeTop: { type: [String, Number] as PropType<string | number>, default: '' }
|
|
22
22
|
};
|
|
@@ -31,7 +31,7 @@ import { $u } from '../../';
|
|
|
31
31
|
* timeLineItem 时间轴Item
|
|
32
32
|
* @description 时间轴组件一般用于物流信息展示,各种跟时间相关的记录等场景。(搭配u-time-line使用)
|
|
33
33
|
* @tutorial https://uviewpro.cn/zh/components/timeLine.html
|
|
34
|
-
* @property {String} bg-color 左边节点的背景颜色,一般通过slot内容自定义背景颜色即可(默认
|
|
34
|
+
* @property {String} bg-color 左边节点的背景颜色,一般通过slot内容自定义背景颜色即可(默认transparent)
|
|
35
35
|
* @property {String | Number} node-top 节点左边图标绝对定位的top值,单位rpx
|
|
36
36
|
* @example <u-time-line-item node-top="2">...</u-time-line-item>
|
|
37
37
|
*/
|
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.6.
|
|
5
|
+
"version": "0.6.21",
|
|
6
6
|
"description": "uView Pro是基于Vue3+TS的多平台UI框架,提供80+高质量组件、便捷工具和常用模板,支持多主题、暗黑模式、多语言,支持H5/APP/鸿蒙/小程序多端开发。已在鸿蒙应用商店上架,欢迎体验!",
|
|
7
7
|
"main": "index.ts",
|
|
8
8
|
"module": "index.ts",
|