uview-pro 0.4.3 → 0.4.4
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,18 +1,35 @@
|
|
|
1
|
-
## 0.4.
|
|
1
|
+
## 0.4.4(2025-12-08)
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### ✨ Features | 新功能
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- **
|
|
5
|
+
- **u-card:** u-card 组件的默认插槽同 body 插槽 ([ffa13ed](https://github.com/anyup/uView-Pro/commit/ffa13edcf17ff1559e8bdf2260f6b146680f9d07))
|
|
6
|
+
- **u-tag:** 优化自定义样式 custom-style 应用,支持 text 插槽内容 ([5bdb733](https://github.com/anyup/uView-Pro/commit/5bdb73346252850d74165cda0bb00766e5f6f59f))
|
|
7
|
+
- **u-line-progress:** 优化u-line-progress进度条百分比显示方式 ([1c1d979](https://github.com/anyup/uView-Pro/commit/1c1d97958f3c7e5a28943b46ea25d38b50449364))
|
|
8
|
+
- **switch:** 增强开关组件支持自定义值类型 ([2bcb136](https://github.com/anyup/uView-Pro/commit/2bcb1368aa1f3c7fe83799e909b89fc4349b30c3))
|
|
7
9
|
|
|
8
|
-
###
|
|
10
|
+
### 📝 Documentation | 文档
|
|
9
11
|
|
|
10
|
-
-
|
|
12
|
+
- 优化 Markdown 文档样式和格式 ([c80ff6d](https://github.com/anyup/uView-Pro/commit/c80ff6df269eb92a88001373aa96344ff4cafb79))
|
|
11
13
|
|
|
12
14
|
### 👥 Contributors
|
|
13
15
|
|
|
14
|
-
<a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
|
|
16
|
+
<a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a> <a href="https://github.com/liujiayii"><img src="https://github.com/liujiayii.png?size=40" width="40" height="40" alt="liujiayii" title="liujiayii"/></a>
|
|
15
17
|
|
|
18
|
+
## 0.4.3(2025-12-03)
|
|
19
|
+
|
|
20
|
+
### 📝 Documentation | 文档
|
|
21
|
+
|
|
22
|
+
- 更新项目描述和移除冗余信息 ([3d5c105](https://github.com/anyup/uView-Pro/commit/3d5c1053873a1a1dc592e02caf62b5e5f9aba3ad))
|
|
23
|
+
- **readme:** 更新交流反馈和捐赠链接 ([266e788](https://github.com/anyup/uView-Pro/commit/266e7883a4e2f3ea8058e0bba0b7ce07a972bad8))
|
|
24
|
+
|
|
25
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
26
|
+
|
|
27
|
+
- **theme:** 修复不使用 u-config-privider 全局注入时,部分颜色变量不存在的问题 ([cd82d9d](https://github.com/anyup/uView-Pro/commit/cd82d9da3e8fd6066177e3b78b855583e2756a5f))
|
|
28
|
+
|
|
29
|
+
### 👥 Contributors
|
|
30
|
+
|
|
31
|
+
<a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
|
|
32
|
+
|
|
16
33
|
## 0.4.2(2025-12-01)
|
|
17
34
|
|
|
18
35
|
### 📝 Documentation | 文档
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
:style="progressStyle"
|
|
18
18
|
>
|
|
19
19
|
<slot v-if="slots.default" />
|
|
20
|
-
<
|
|
20
|
+
<text class="u-progress-text" v-else-if="showPercent">
|
|
21
21
|
{{ percent + '%' }}
|
|
22
|
-
</
|
|
22
|
+
</text>
|
|
23
23
|
</view>
|
|
24
24
|
</view>
|
|
25
25
|
</template>
|
|
@@ -114,6 +114,11 @@ const progressStyle = computed(() => {
|
|
|
114
114
|
animation: progress-stripes 2s linear infinite;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
.u-progress-text {
|
|
118
|
+
color: var(--u-light-color);
|
|
119
|
+
padding: 0 10rpx;
|
|
120
|
+
}
|
|
121
|
+
|
|
117
122
|
@keyframes progress-stripes {
|
|
118
123
|
0% {
|
|
119
124
|
background-position: 0 0;
|
|
@@ -18,8 +18,8 @@ export const SwitchProps = {
|
|
|
18
18
|
activeColor: { type: String, default: () => getColor('primary') },
|
|
19
19
|
/** 关闭时的颜色 */
|
|
20
20
|
inactiveColor: { type: String, default: 'var(--u-white-color)' },
|
|
21
|
-
/** v-model
|
|
22
|
-
modelValue: { type:
|
|
21
|
+
/** v-model 绑定值,开关状态值 */
|
|
22
|
+
modelValue: { type: [Number, String, Boolean] as PropType<number | string | boolean>, default: false },
|
|
23
23
|
/** 是否开启轻微震动反馈 */
|
|
24
24
|
vibrateShort: { type: Boolean, default: false },
|
|
25
25
|
/** 打开时的值 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
3
|
class="u-switch"
|
|
4
|
-
:class="[
|
|
4
|
+
:class="[isChecked ? 'u-switch--on' : '', disabled ? 'u-switch--disabled' : '', customClass]"
|
|
5
5
|
@tap="onClick"
|
|
6
6
|
:style="$u.toStyle(switchStyle, customStyle)"
|
|
7
7
|
>
|
|
@@ -53,20 +53,28 @@ const props = defineProps(SwitchProps);
|
|
|
53
53
|
|
|
54
54
|
const emit = defineEmits(['update:modelValue', 'change']);
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* 计算属性:是否处于激活状态
|
|
58
|
+
* 通过比较modelValue和activeValue来确定开关的真实状态
|
|
59
|
+
*/
|
|
60
|
+
const isChecked = computed(() => {
|
|
61
|
+
return props.modelValue === props.activeValue;
|
|
62
|
+
});
|
|
63
|
+
|
|
56
64
|
/**
|
|
57
65
|
* 计算开关样式
|
|
58
66
|
*/
|
|
59
67
|
const switchStyle = computed(() => {
|
|
60
68
|
let style: Record<string, string> = {};
|
|
61
69
|
style.fontSize = props.size + 'rpx';
|
|
62
|
-
style.backgroundColor =
|
|
70
|
+
style.backgroundColor = isChecked.value ? props.activeColor : props.inactiveColor;
|
|
63
71
|
return style;
|
|
64
72
|
});
|
|
65
73
|
/**
|
|
66
74
|
* 计算加载动画颜色
|
|
67
75
|
*/
|
|
68
76
|
const loadingColor = computed(() => {
|
|
69
|
-
return
|
|
77
|
+
return isChecked.value ? props.activeColor : null;
|
|
70
78
|
});
|
|
71
79
|
|
|
72
80
|
/**
|
|
@@ -76,10 +84,13 @@ function onClick() {
|
|
|
76
84
|
if (!props.disabled && !props.loading) {
|
|
77
85
|
// 使手机产生短促震动,微信小程序有效,APP(HX 2.6.8)和H5无效
|
|
78
86
|
if (props.vibrateShort) uni.vibrateShort();
|
|
79
|
-
|
|
87
|
+
|
|
88
|
+
// 根据当前状态切换到另一个值
|
|
89
|
+
const newValue = isChecked.value ? props.inactiveValue : props.activeValue;
|
|
90
|
+
emit('update:modelValue', newValue);
|
|
80
91
|
// 放到下一个生命周期,因为双向绑定的value修改父组件状态需要时间,且是异步的
|
|
81
92
|
nextTick(() => {
|
|
82
|
-
emit('change',
|
|
93
|
+
emit('change', newValue);
|
|
83
94
|
});
|
|
84
95
|
}
|
|
85
96
|
}
|
|
@@ -113,11 +124,6 @@ function onClick() {
|
|
|
113
124
|
border-radius: 100%;
|
|
114
125
|
z-index: 1;
|
|
115
126
|
background-color: var(--u-bg-white);
|
|
116
|
-
background-color: var(--u-bg-white);
|
|
117
|
-
box-shadow:
|
|
118
|
-
0 3px 1px 0 rgba(0, 0, 0, 0.05),
|
|
119
|
-
0 2px 2px 0 rgba(0, 0, 0, 0.1),
|
|
120
|
-
0 3px 3px 0 rgba(0, 0, 0, 0.05);
|
|
121
127
|
box-shadow:
|
|
122
128
|
0 3px 1px 0 rgba(0, 0, 0, 0.05),
|
|
123
129
|
0 2px 2px 0 rgba(0, 0, 0, 0.1),
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
customClass
|
|
10
10
|
]"
|
|
11
11
|
class="u-tag"
|
|
12
|
-
:style="$u.toStyle(customStyle)"
|
|
12
|
+
:style="$u.toStyle(tagStyle, customStyle)"
|
|
13
13
|
@tap="clickTag"
|
|
14
14
|
>
|
|
15
|
-
|
|
15
|
+
<slot>
|
|
16
|
+
{{ text }}
|
|
17
|
+
</slot>
|
|
16
18
|
<view class="u-icon-wrap" @tap.stop>
|
|
17
19
|
<u-icon
|
|
18
20
|
@click="close"
|
|
@@ -75,7 +77,7 @@ const props = defineProps(TagProps);
|
|
|
75
77
|
/**
|
|
76
78
|
* 计算 tag 的自定义样式
|
|
77
79
|
*/
|
|
78
|
-
const
|
|
80
|
+
const tagStyle = computed(() => {
|
|
79
81
|
let style: Record<string, any> = {};
|
|
80
82
|
// 文字颜色(如果有此值,会覆盖type值的颜色)
|
|
81
83
|
if (props.color) style.color = props.color;
|
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的80+精选UI组件库,支持多主题,暗黑模式",
|
|
5
|
-
"version": "0.4.
|
|
5
|
+
"version": "0.4.4",
|
|
6
6
|
"description": "uView Pro,是全面支持Vue3+TS的uni-app生态框架,80+精选组件,支持安卓,iOS,鸿蒙,各小程序平台,支持多主题,一键暗黑模式",
|
|
7
7
|
"main": "index.ts",
|
|
8
8
|
"module": "index.ts",
|