uview-plus 3.3.8 → 3.3.9
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 +17 -0
- package/components/u-album/props.js +10 -0
- package/components/u-album/u-album.vue +31 -23
- package/components/u-calendar/month.vue +1 -0
- package/components/u-index-list/u-index-list.vue +8 -1
- package/components/u-loading-page/props.js +6 -1
- package/components/u-loading-page/u-loading-page.vue +3 -0
- package/components/u-modal/props.js +6 -1
- package/components/u-modal/u-modal.vue +3 -1
- package/components/u-tabbar-item/u-tabbar-item.vue +1 -2
- package/libs/config/props/album.js +3 -1
- package/libs/config/props/loadingPage.js +2 -1
- package/libs/config/props/modal.js +2 -1
- package/libs/mixin/mixin.js +9 -2
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 3.3.9(2024-08-01)
|
|
2
|
+
fix: 优化获取nvue元素
|
|
3
|
+
|
|
4
|
+
feat: modal新增contentTextAlign设置文案对齐方式
|
|
5
|
+
|
|
6
|
+
fix: 修复NVUE下tabbar文字不显示 #458
|
|
7
|
+
|
|
8
|
+
feat: loading-page增加zIndex属性
|
|
9
|
+
|
|
10
|
+
fix: 相册在宽度较小时换行问题
|
|
11
|
+
|
|
12
|
+
feat: album相册增加自适应自动换行模式
|
|
13
|
+
|
|
14
|
+
feat: album相册增加图片尺寸单位prop
|
|
15
|
+
|
|
16
|
+
fix: 修复calendar日历月份居中
|
|
17
|
+
|
|
1
18
|
## 3.3.8(2024-07-31)
|
|
2
19
|
feat: slider支持进度条任意位置触发按钮拖动
|
|
3
20
|
|
|
@@ -66,6 +66,16 @@ export const props = defineMixin({
|
|
|
66
66
|
radius: {
|
|
67
67
|
type: [String, Number],
|
|
68
68
|
default: () => defProps.image.radius
|
|
69
|
+
},
|
|
70
|
+
// 自适应换行
|
|
71
|
+
autoWrap: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: () => defProps.album.autoWrap
|
|
74
|
+
},
|
|
75
|
+
// 单位
|
|
76
|
+
unit: {
|
|
77
|
+
type: [String],
|
|
78
|
+
default: () => defProps.album.unit
|
|
69
79
|
}
|
|
70
80
|
}
|
|
71
81
|
})
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
v-for="(arr, index) in showUrls"
|
|
7
7
|
:forComputedUse="albumWidth"
|
|
8
8
|
:key="index"
|
|
9
|
+
:style="{flexWrap: autoWrap ? 'wrap' : 'nowrap'}"
|
|
9
10
|
>
|
|
10
11
|
<view
|
|
11
12
|
class="u-album__row__wrapper"
|
|
@@ -85,6 +86,8 @@ const dom = uni.requireNativePlugin('dom')
|
|
|
85
86
|
* @property {Boolean} showMore 超出maxCount时是否显示查看更多的提示 (默认 true )
|
|
86
87
|
* @property {String} shape 图片形状,circle-圆形,square-方形 (默认 'square' )
|
|
87
88
|
* @property {String | Number} radius 圆角值,单位任意,如果为数值,则为px单位 (默认 0 )
|
|
89
|
+
* @property {Boolean} autoWrap 自适应换行模式,不受rowCount限制,图片会自动换行 (默认 false )
|
|
90
|
+
* @property {String} unit 图片单位 (默认 px )
|
|
88
91
|
* @event {Function} albumWidth 某些特殊的情况下,需要让文字与相册的宽度相等,这里事件的形式对外发送 (回调参数 width )
|
|
89
92
|
* @example <u-album :urls="urls2" @albumWidth="width => albumWidth = width" multipleSize="68" ></u-album>
|
|
90
93
|
*/
|
|
@@ -124,42 +127,48 @@ export default {
|
|
|
124
127
|
marginBottom: addUnit(space)
|
|
125
128
|
}
|
|
126
129
|
// 如果为最后一行,则每个图片都无需下边框
|
|
127
|
-
if (index1 === rowLen) style.marginBottom = 0
|
|
130
|
+
if (index1 === rowLen && !this.autoWrap) style.marginBottom = 0
|
|
128
131
|
// 每行的最右边一张和总长度的最后一张无需右边框
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
if (!this.autoWrap) {
|
|
133
|
+
if (
|
|
134
|
+
index2 === rowCount ||
|
|
135
|
+
(index1 === rowLen &&
|
|
136
|
+
index2 === this.showUrls[index1 - 1].length)
|
|
137
|
+
)
|
|
138
|
+
style.marginRight = 0
|
|
139
|
+
}
|
|
135
140
|
return style
|
|
136
141
|
}
|
|
137
142
|
},
|
|
138
143
|
// 将数组划分为二维数组
|
|
139
144
|
showUrls() {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
if (this.autoWrap) {
|
|
146
|
+
return [ this.urls.slice(0, this.maxCount) ];
|
|
147
|
+
} else {
|
|
148
|
+
const arr = []
|
|
149
|
+
this.urls.map((item, index) => {
|
|
150
|
+
// 限制最大展示数量
|
|
151
|
+
if (index + 1 <= this.maxCount) {
|
|
152
|
+
// 计算该元素为第几个素组内
|
|
153
|
+
const itemIndex = Math.floor(index / this.rowCount)
|
|
154
|
+
// 判断对应的索引是否存在
|
|
155
|
+
if (!arr[itemIndex]) {
|
|
156
|
+
arr[itemIndex] = []
|
|
157
|
+
}
|
|
158
|
+
arr[itemIndex].push(item)
|
|
149
159
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
return arr
|
|
160
|
+
})
|
|
161
|
+
return arr
|
|
162
|
+
}
|
|
154
163
|
},
|
|
155
164
|
imageWidth() {
|
|
156
165
|
return addUnit(
|
|
157
|
-
this.urls.length === 1 ? this.singleWidth : this.multipleSize
|
|
166
|
+
this.urls.length === 1 ? this.singleWidth : this.multipleSize, this.unit
|
|
158
167
|
)
|
|
159
168
|
},
|
|
160
169
|
imageHeight() {
|
|
161
170
|
return addUnit(
|
|
162
|
-
this.urls.length === 1 ? this.singleHeight : this.multipleSize
|
|
171
|
+
this.urls.length === 1 ? this.singleHeight : this.multipleSize, this.unit
|
|
163
172
|
)
|
|
164
173
|
},
|
|
165
174
|
// 此变量无实际用途,仅仅是为了利用computed特性,让其在urls长度等变化时,重新计算图片的宽度
|
|
@@ -248,7 +257,6 @@ export default {
|
|
|
248
257
|
|
|
249
258
|
&__row {
|
|
250
259
|
@include flex(row);
|
|
251
|
-
flex-wrap: wrap;
|
|
252
260
|
|
|
253
261
|
&__wrapper {
|
|
254
262
|
position: relative;
|
|
@@ -441,7 +441,14 @@
|
|
|
441
441
|
// #endif
|
|
442
442
|
|
|
443
443
|
// #ifdef APP-NVUE
|
|
444
|
-
|
|
444
|
+
let headerRef = this.$refs.header
|
|
445
|
+
if (!headerRef) {
|
|
446
|
+
resolve({
|
|
447
|
+
width: 0,
|
|
448
|
+
height: 0
|
|
449
|
+
})
|
|
450
|
+
}
|
|
451
|
+
dom.getComponentRect(headerRef, res => {
|
|
445
452
|
resolve(res.size)
|
|
446
453
|
})
|
|
447
454
|
// #endif
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
bottom: 0,
|
|
10
10
|
backgroundColor: bgColor,
|
|
11
11
|
display: 'flex',
|
|
12
|
+
zIndex: zIndex,
|
|
13
|
+
...customStyle
|
|
12
14
|
}"
|
|
13
15
|
>
|
|
14
16
|
<view class="u-loading-page">
|
|
@@ -64,6 +66,7 @@ import { addUnit } from '../../libs/function/index';
|
|
|
64
66
|
* @property {String | Number} fontSize 文字大小 (默认 19 )
|
|
65
67
|
* @property {String | Number} iconSize 图标大小 (默认 28 )
|
|
66
68
|
* @property {String} loadingColor 加载中图标的颜色,只能rgb或者十六进制颜色值 (默认 '#C8C8C8' )
|
|
69
|
+
* @property {Number} zIndex z-index层级 (默认10 )
|
|
67
70
|
* @property {Object} customStyle 自定义样式
|
|
68
71
|
* @example <u-loading mode="circle"></u-loading>
|
|
69
72
|
*/
|
|
@@ -81,6 +81,11 @@ export const props = defineMixin({
|
|
|
81
81
|
confirmButtonShape: {
|
|
82
82
|
type: String,
|
|
83
83
|
default: () => defProps.modal.confirmButtonShape
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
|
+
// 文案对齐方式
|
|
86
|
+
contentTextAlign: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: () => defProps.modal.contentTextAlign
|
|
89
|
+
},
|
|
85
90
|
}
|
|
86
91
|
})
|
package/libs/mixin/mixin.js
CHANGED
|
@@ -130,8 +130,15 @@ export const mixin = defineMixin({
|
|
|
130
130
|
let selectorNvue = selector.substring(1) // 去掉开头的#或者.
|
|
131
131
|
let selectorRef = this.$refs[selectorNvue]
|
|
132
132
|
if (!selectorRef) {
|
|
133
|
-
console.log('不存在元素,请检查是否设置了ref属性' + selectorNvue + '。')
|
|
134
|
-
resolve({
|
|
133
|
+
// console.log('不存在元素,请检查是否设置了ref属性' + selectorNvue + '。')
|
|
134
|
+
resolve({
|
|
135
|
+
with: 0,
|
|
136
|
+
height: 0,
|
|
137
|
+
left: 0,
|
|
138
|
+
right: 0,
|
|
139
|
+
top: 0,
|
|
140
|
+
bottom: 0
|
|
141
|
+
})
|
|
135
142
|
}
|
|
136
143
|
dom.getComponentRect(selectorRef, res => {
|
|
137
144
|
// console.log(res)
|