uview-plus 3.3.41 → 3.3.43
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 +10 -1
- package/components/u-button/button.js +2 -1
- package/components/u-button/props.js +6 -1
- package/components/u-button/u-button.vue +3 -1
- package/components/u-float-button/u-float-button.vue +167 -0
- package/components/u-image/u-image.vue +1 -1
- package/components/u-slider/u-slider.vue +1 -1
- package/components/u-waterfall/u-waterfall.vue +19 -8
- package/libs/function/index.js +12 -0
- package/package.json +2 -2
package/changelog.md
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
## 3.3.43(2024-11-18)
|
|
2
|
+
fix: 支持瀑布流组件v-model置为[]
|
|
3
|
+
|
|
4
|
+
add: 新增字符串路径访问工具方法getValueByPath
|
|
5
|
+
|
|
6
|
+
add: 新增float-button悬浮按钮组件
|
|
7
|
+
|
|
8
|
+
## 3.3.42(2024-11-15)
|
|
9
|
+
add: button组件支持stop参数阻止冒泡
|
|
10
|
+
|
|
1
11
|
## 3.3.41(2024-11-13)
|
|
2
12
|
fix: u-radio-group invalid import
|
|
3
13
|
|
|
4
14
|
improvement: 优化图片组件宽高及修复事件event传递
|
|
5
15
|
|
|
6
|
-
|
|
7
16
|
## 3.3.40(2024-11-11)
|
|
8
17
|
add: 组件radioGroup增加gap属性用于设置item间隔
|
|
9
18
|
|
|
@@ -271,7 +271,7 @@ export default {
|
|
|
271
271
|
'error', 'opensetting', 'launchapp', 'agreeprivacyauthorization'],
|
|
272
272
|
methods: {
|
|
273
273
|
addStyle,
|
|
274
|
-
clickHandler() {
|
|
274
|
+
clickHandler(e: any) {
|
|
275
275
|
// 非禁止并且非加载中,才能点击
|
|
276
276
|
if (!this.disabled && !this.loading) {
|
|
277
277
|
// 进行节流控制,每this.throttle毫秒内,只在开始处执行
|
|
@@ -279,6 +279,8 @@ export default {
|
|
|
279
279
|
this.$emit("click");
|
|
280
280
|
}, this.throttleTime);
|
|
281
281
|
}
|
|
282
|
+
// 是否阻止事件传播
|
|
283
|
+
this.stop && this.preventEvent(e)
|
|
282
284
|
},
|
|
283
285
|
// 下面为对接uniapp官方按钮开放能力事件回调的对接
|
|
284
286
|
getphonenumber(res: any) {
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="u-float-button" :style="{
|
|
4
|
+
position: 'fixed',
|
|
5
|
+
top: top,
|
|
6
|
+
bottom: bottom,
|
|
7
|
+
right: right,
|
|
8
|
+
}">
|
|
9
|
+
<view class="u-float-button__main" @click="clickHandler" :style="{
|
|
10
|
+
backgroundColor: backgroundColor,
|
|
11
|
+
color: color,
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
width: width,
|
|
16
|
+
height: height,
|
|
17
|
+
borderRadius: '50%',
|
|
18
|
+
borderColor: borderColor,
|
|
19
|
+
}">
|
|
20
|
+
<slot :showList="showList">
|
|
21
|
+
<up-icon class="cursor-pointer" :class="{'show-list': showList}" name="plus" :color="color"></up-icon>
|
|
22
|
+
</slot>
|
|
23
|
+
<view v-if="showList" class="u-float-button__list" :style="{
|
|
24
|
+
bottom: height
|
|
25
|
+
}">
|
|
26
|
+
<slot name="list">
|
|
27
|
+
<template v-for="item in list">
|
|
28
|
+
<view class="u-float-button__item" :style="{
|
|
29
|
+
backgroundColor: item?.backgroundColor ? item?.backgroundColor : backgroundColor,
|
|
30
|
+
color: item?.color ? item?.color : color,
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
width: width,
|
|
35
|
+
height: height,
|
|
36
|
+
borderRadius: '50%',
|
|
37
|
+
borderColor: item?.borderColor ? item?.borderColor : borderColor,
|
|
38
|
+
}" @click="itemClick(item, index)">
|
|
39
|
+
<up-icon :name="item.name" :color="item?.color ? item?.color : color"></up-icon>
|
|
40
|
+
</view>
|
|
41
|
+
</template>
|
|
42
|
+
</slot>
|
|
43
|
+
</view>
|
|
44
|
+
</view>
|
|
45
|
+
</view>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { mpMixin } from '../../libs/mixin/mpMixin';
|
|
50
|
+
import { mixin } from '../../libs/mixin/mixin';
|
|
51
|
+
import { addStyle, addUnit, deepMerge } from '../../libs/function/index';
|
|
52
|
+
/**
|
|
53
|
+
* FloatButton 悬浮按钮
|
|
54
|
+
* @description 悬浮按钮常用于屏幕右下角点击展开的操作菜单
|
|
55
|
+
* @tutorial https://ijry.github.io/uview-plus/components/floatButton.html
|
|
56
|
+
* @property {String} backgroundColor 背景颜色
|
|
57
|
+
* @event {Function} click 点击触发事件
|
|
58
|
+
* @example <up-float-button></up-float-button>
|
|
59
|
+
*/
|
|
60
|
+
export default {
|
|
61
|
+
name: 'u-float-button',
|
|
62
|
+
// #ifdef MP
|
|
63
|
+
mixins: [mpMixin, mixin],
|
|
64
|
+
// #endif
|
|
65
|
+
// #ifndef MP
|
|
66
|
+
mixins: [mpMixin, mixin],
|
|
67
|
+
// #endif
|
|
68
|
+
emits: ['click', 'item-click'],
|
|
69
|
+
computed: {
|
|
70
|
+
},
|
|
71
|
+
props: {
|
|
72
|
+
// 背景颜色
|
|
73
|
+
backgroundColor: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: '#2979ff'
|
|
76
|
+
},
|
|
77
|
+
// 文字颜色
|
|
78
|
+
color: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: '#fff'
|
|
81
|
+
},
|
|
82
|
+
// 宽度
|
|
83
|
+
width: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: '50px'
|
|
86
|
+
},
|
|
87
|
+
// 高度
|
|
88
|
+
height: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: '50px'
|
|
91
|
+
},
|
|
92
|
+
// 边框颜色,默认为空字符串表示无边框
|
|
93
|
+
borderColor: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: ''
|
|
96
|
+
},
|
|
97
|
+
// 右侧偏移量
|
|
98
|
+
right: {
|
|
99
|
+
type: [String, Number],
|
|
100
|
+
default: '30px'
|
|
101
|
+
},
|
|
102
|
+
// 顶部偏移量,未提供默认值,可能需要根据具体情况设置
|
|
103
|
+
top: {
|
|
104
|
+
type: [String, Number],
|
|
105
|
+
default: '',
|
|
106
|
+
},
|
|
107
|
+
// 底部偏移量
|
|
108
|
+
bottom: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: ''
|
|
111
|
+
},
|
|
112
|
+
// 是否为菜单项
|
|
113
|
+
isMenu: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: false
|
|
116
|
+
},
|
|
117
|
+
list: {
|
|
118
|
+
type: Array,
|
|
119
|
+
default: () => {
|
|
120
|
+
return []
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
data() {
|
|
125
|
+
return {
|
|
126
|
+
showList: false
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
methods: {
|
|
130
|
+
addStyle,
|
|
131
|
+
clickHandler(e) {
|
|
132
|
+
if (this.isMenu) {
|
|
133
|
+
this.showList = !this.showList
|
|
134
|
+
this.$emit('click', e)
|
|
135
|
+
} else {
|
|
136
|
+
this.$emit('click', e)
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
itemClick(item, index) {
|
|
140
|
+
this.$emit('item-click', {
|
|
141
|
+
...item,
|
|
142
|
+
index
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
<style lang="scss" scoped>
|
|
150
|
+
@import '../../libs/css/components.scss';
|
|
151
|
+
|
|
152
|
+
.u-float-button {
|
|
153
|
+
z-index: 999;
|
|
154
|
+
.show-list {
|
|
155
|
+
transform: rotate(45deg);
|
|
156
|
+
}
|
|
157
|
+
&__list {
|
|
158
|
+
position: absolute;
|
|
159
|
+
bottom: 0px;
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-direction: column;
|
|
162
|
+
>view {
|
|
163
|
+
margin: 5px 0px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
</style>
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
// 触摸后第一次移动已经将status设置为moving状态,故触摸第二次移动不会触发本事件
|
|
275
275
|
if (this.status == 'start') this.$emit('start');
|
|
276
276
|
let touches = event.touches[0];
|
|
277
|
-
console.log('touchs', touches)
|
|
277
|
+
// console.log('touchs', touches)
|
|
278
278
|
// 滑块的左边不一定跟屏幕左边接壤,所以需要减去最外层父元素的左边值
|
|
279
279
|
let clientX = 0;
|
|
280
280
|
// #ifndef APP-NVUE
|
|
@@ -67,11 +67,16 @@
|
|
|
67
67
|
},
|
|
68
68
|
watch: {
|
|
69
69
|
copyFlowList(nVal, oVal) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
if (!nVal || nVal.length == 0) {
|
|
71
|
+
this.clear();
|
|
72
|
+
// console.log('clear');
|
|
73
|
+
} else {
|
|
74
|
+
// 取差值,即这一次数组变化新增的部分
|
|
75
|
+
let startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0;
|
|
76
|
+
// 拼接上原有数据
|
|
77
|
+
this.tempList = this.tempList.concat(this.cloneData(nVal.slice(startIndex)));
|
|
78
|
+
this.splitData();
|
|
79
|
+
}
|
|
75
80
|
}
|
|
76
81
|
},
|
|
77
82
|
mounted() {
|
|
@@ -81,12 +86,18 @@
|
|
|
81
86
|
computed: {
|
|
82
87
|
// 破坏flowList变量的引用,否则watch的结果新旧值是一样的
|
|
83
88
|
copyFlowList() {
|
|
89
|
+
// #ifdef VUE3
|
|
90
|
+
if (!this.modelValue || this.modelValue.length == 0) {
|
|
91
|
+
this.clear();
|
|
92
|
+
// console.log('clear');
|
|
93
|
+
return [];
|
|
94
|
+
} else {
|
|
95
|
+
return this.cloneData(this.modelValue);
|
|
96
|
+
}
|
|
97
|
+
// #endif
|
|
84
98
|
// #ifdef VUE2
|
|
85
99
|
return this.cloneData(this.value);
|
|
86
100
|
// #endif
|
|
87
|
-
// #ifdef VUE3
|
|
88
|
-
return this.cloneData(this.modelValue);
|
|
89
|
-
// #endif
|
|
90
101
|
}
|
|
91
102
|
},
|
|
92
103
|
emits: ['update:modelValue'],
|
package/libs/function/index.js
CHANGED
|
@@ -694,6 +694,17 @@ export function pages() {
|
|
|
694
694
|
return pages
|
|
695
695
|
}
|
|
696
696
|
|
|
697
|
+
export function getValueByPath(obj, path) {
|
|
698
|
+
// 将路径字符串按 '.' 分割成数组
|
|
699
|
+
const pathArr = path.split('.');
|
|
700
|
+
// 使用 reduce 方法从 obj 开始,逐级访问嵌套属性
|
|
701
|
+
return pathArr.reduce((acc, curr) => {
|
|
702
|
+
// 如果当前累加器(acc)是对象且包含当前键(curr),则返回该键对应的值
|
|
703
|
+
// 否则返回 undefined(表示路径不存在)
|
|
704
|
+
return acc && acc[curr] !== undefined ? acc[curr] : undefined;
|
|
705
|
+
}, obj);
|
|
706
|
+
}
|
|
707
|
+
|
|
697
708
|
export default {
|
|
698
709
|
range,
|
|
699
710
|
getPx,
|
|
@@ -724,5 +735,6 @@ export default {
|
|
|
724
735
|
setProperty,
|
|
725
736
|
page,
|
|
726
737
|
pages,
|
|
738
|
+
getValueByPath,
|
|
727
739
|
// setConfig
|
|
728
740
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "uview-plus",
|
|
3
3
|
"name": "uview-plus",
|
|
4
|
-
"displayName": "
|
|
5
|
-
"version": "3.3.
|
|
4
|
+
"displayName": "uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
|
|
5
|
+
"version": "3.3.43",
|
|
6
6
|
"description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"uview",
|