uview-plus 3.3.22 → 3.3.24
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 +12 -0
- package/components/u-copy/u-copy.vue +1 -1
- package/components/u-datetime-picker/u-datetime-picker.vue +46 -39
- package/components/u-index-list/u-index-list.vue +7 -7
- package/components/u-lazy-load/u-lazy-load.vue +1 -1
- package/components/u-navbar-mini/u-navbar-mini.vue +0 -1
- package/components/u-picker-column/props.js +2 -2
- package/components/u-qrcode/u-qrcode.vue +1 -1
- package/components/u-table/props.js +2 -2
- package/components/u-tabs/u-tabs.vue +3 -0
- package/components/u-tabs-item/props.js +2 -2
- package/components/u-td/props.js +1 -1
- package/components/u-toolbar/u-toolbar.vue +1 -1
- package/components/u-tr/props.js +2 -2
- package/index.js +39 -0
- package/libs/mixin/mixin.js +3 -0
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 3.3.24(2024-08-19)
|
|
2
|
+
fix: 修复时间选择器hasInput模式小程序不生效
|
|
3
|
+
|
|
4
|
+
feat: 支持H5导入所有组件
|
|
5
|
+
|
|
6
|
+
## 3.3.23(2024-08-17)
|
|
7
|
+
feat: swipe-action增加closeAll方法
|
|
8
|
+
|
|
9
|
+
fix: 兼容tabs在某些场景下index小于0时自动设置为0
|
|
10
|
+
|
|
11
|
+
add: 通用mixin新增navTo页面跳转方法
|
|
12
|
+
|
|
1
13
|
## 3.3.21(2024-08-15)
|
|
2
14
|
improvement: 优化二维码组件loading及支持预览与长按事件 #351
|
|
3
15
|
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
3
|
-
<u-input
|
|
4
|
-
:placeholder="placeholder"
|
|
5
|
-
:readonly="!!showByClickInput"
|
|
6
|
-
border="surround"
|
|
7
|
-
v-model="inputValue"
|
|
2
|
+
<view class="u-datetime-picker">
|
|
3
|
+
<view v-if="hasInput" class="u-datetime-picker__has-input"
|
|
8
4
|
@click="showByClickInput = !showByClickInput"
|
|
9
|
-
|
|
5
|
+
>
|
|
6
|
+
<up-input
|
|
7
|
+
:placeholder="placeholder"
|
|
8
|
+
:readonly="!!showByClickInput"
|
|
9
|
+
border="surround"
|
|
10
|
+
v-model="inputValue"
|
|
11
|
+
></up-input>
|
|
12
|
+
</view>
|
|
13
|
+
<u-picker
|
|
14
|
+
ref="picker"
|
|
15
|
+
:show="show || (hasInput && showByClickInput)"
|
|
16
|
+
:popupMode="popupMode"
|
|
17
|
+
:closeOnClickOverlay="closeOnClickOverlay"
|
|
18
|
+
:columns="columns"
|
|
19
|
+
:title="title"
|
|
20
|
+
:itemHeight="itemHeight"
|
|
21
|
+
:showToolbar="showToolbar"
|
|
22
|
+
:visibleItemCount="visibleItemCount"
|
|
23
|
+
:defaultIndex="innerDefaultIndex"
|
|
24
|
+
:cancelText="cancelText"
|
|
25
|
+
:confirmText="confirmText"
|
|
26
|
+
:cancelColor="cancelColor"
|
|
27
|
+
:confirmColor="confirmColor"
|
|
28
|
+
:toolbarRightSlot="toolbarRightSlot"
|
|
29
|
+
@close="close"
|
|
30
|
+
@cancel="cancel"
|
|
31
|
+
@confirm="confirm"
|
|
32
|
+
@change="change"
|
|
33
|
+
>
|
|
34
|
+
<template #toolbar-right>
|
|
35
|
+
<slot name="toolbar-right">
|
|
36
|
+
</slot>
|
|
37
|
+
</template>
|
|
38
|
+
<template #toolbar-bottom>
|
|
39
|
+
<slot name="toolbar-bottom">
|
|
40
|
+
</slot>
|
|
41
|
+
</template>
|
|
42
|
+
</u-picker>
|
|
10
43
|
</view>
|
|
11
|
-
<u-picker
|
|
12
|
-
ref="picker"
|
|
13
|
-
:show="show || (hasInput && showByClickInput)"
|
|
14
|
-
:popupMode="popupMode"
|
|
15
|
-
:closeOnClickOverlay="closeOnClickOverlay"
|
|
16
|
-
:columns="columns"
|
|
17
|
-
:title="title"
|
|
18
|
-
:itemHeight="itemHeight"
|
|
19
|
-
:showToolbar="showToolbar"
|
|
20
|
-
:visibleItemCount="visibleItemCount"
|
|
21
|
-
:defaultIndex="innerDefaultIndex"
|
|
22
|
-
:cancelText="cancelText"
|
|
23
|
-
:confirmText="confirmText"
|
|
24
|
-
:cancelColor="cancelColor"
|
|
25
|
-
:confirmColor="confirmColor"
|
|
26
|
-
:toolbarRightSlot="toolbarRightSlot"
|
|
27
|
-
@close="close"
|
|
28
|
-
@cancel="cancel"
|
|
29
|
-
@confirm="confirm"
|
|
30
|
-
@change="change"
|
|
31
|
-
>
|
|
32
|
-
<template #toolbar-right>
|
|
33
|
-
<slot name="toolbar-right">
|
|
34
|
-
</slot>
|
|
35
|
-
</template>
|
|
36
|
-
<template #toolbar-bottom>
|
|
37
|
-
<slot name="toolbar-bottom">
|
|
38
|
-
</slot>
|
|
39
|
-
</template>
|
|
40
|
-
</u-picker>
|
|
41
44
|
</template>
|
|
42
45
|
|
|
43
46
|
<script>
|
|
@@ -88,7 +91,7 @@
|
|
|
88
91
|
* @example <u-datetime-picker :show="show" :value="value1" mode="datetime" ></u-datetime-picker>
|
|
89
92
|
*/
|
|
90
93
|
export default {
|
|
91
|
-
name: 'datetime-picker',
|
|
94
|
+
name: 'up-datetime-picker',
|
|
92
95
|
mixins: [mpMixin, mixin, props],
|
|
93
96
|
data() {
|
|
94
97
|
return {
|
|
@@ -460,6 +463,10 @@
|
|
|
460
463
|
<style lang="scss" scoped>
|
|
461
464
|
@import '../../libs/css/components.scss';
|
|
462
465
|
.u-datetime-picker {
|
|
463
|
-
|
|
466
|
+
&__has-input {
|
|
467
|
+
/* #ifndef APP-NVUE */
|
|
468
|
+
width: 100%;
|
|
469
|
+
/* #endif */
|
|
470
|
+
}
|
|
464
471
|
}
|
|
465
472
|
</style>
|
|
@@ -361,16 +361,16 @@
|
|
|
361
361
|
// pageY += sys().windowTop
|
|
362
362
|
// #endif
|
|
363
363
|
// 对第一和最后一个字母做边界处理,因为用户可能在字母列表上触摸到两端的尽头后依然继续滑动
|
|
364
|
-
console.log('top1', top)
|
|
365
|
-
console.log('height', height)
|
|
364
|
+
// console.log('top1', top)
|
|
365
|
+
// console.log('height', height)
|
|
366
366
|
top = top - (height / 2) // 减去transfrom的translateY值导致的高度
|
|
367
367
|
pageY = pageY - this.topOffset
|
|
368
368
|
// if (this.safeBottomFix) {
|
|
369
369
|
// pageY = pageY + 34
|
|
370
370
|
// }
|
|
371
|
-
console.log('topOffset', this.topOffset)
|
|
372
|
-
console.log('pageY', pageY)
|
|
373
|
-
console.log('top2', top)
|
|
371
|
+
// console.log('topOffset', this.topOffset)
|
|
372
|
+
// console.log('pageY', pageY)
|
|
373
|
+
// console.log('top2', top)
|
|
374
374
|
if (pageY < top) {
|
|
375
375
|
index = 0
|
|
376
376
|
} else if (pageY >= top + height) {
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
const header = await this.getHeaderRect()
|
|
402
402
|
// item的top值,在nvue下,模拟出的anchor的top,类似非nvue下的index-item的top
|
|
403
403
|
let top = header.height
|
|
404
|
-
console.log(top)
|
|
404
|
+
// console.log(top)
|
|
405
405
|
const anchors = this.anchors
|
|
406
406
|
// 由于list组件无法获取cell的top值,这里通过header slot和各个item之间的height,模拟出类似非nvue下的位置信息
|
|
407
407
|
let children = this.children.map((item, index) => {
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
// #ifdef APP-NVUE
|
|
427
427
|
// 在nvue中,由于cell和header为同级元素,所以实际是需要对header(anchor)进行偏移
|
|
428
428
|
const anchor = `u-index-anchor-${this.uIndexList[currentIndex]}`
|
|
429
|
-
console.log(anchor)
|
|
429
|
+
// console.log(anchor)
|
|
430
430
|
dom.scrollToElement(this.anchors[currentIndex].$refs[anchor], {
|
|
431
431
|
offset: 0,
|
|
432
432
|
animated: false
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
contentObserver.relativeToViewport({
|
|
220
220
|
bottom: this.getThreshold,
|
|
221
221
|
}).observe('.u-lazy-item-' + this.elIndex, (res) => {
|
|
222
|
-
console.log('relativeToViewport', res)
|
|
222
|
+
// console.log('relativeToViewport', res)
|
|
223
223
|
if (res.intersectionRatio > 0) {
|
|
224
224
|
// 懒加载状态改变
|
|
225
225
|
this.isShow = true;
|
|
@@ -234,6 +234,9 @@
|
|
|
234
234
|
},
|
|
235
235
|
setScrollLeft() {
|
|
236
236
|
// 当前活动tab的布局信息,有tab菜单的width和left(为元素左边界到父元素左边界的距离)等信息
|
|
237
|
+
if (this.innerCurrent < 0) {
|
|
238
|
+
this.innerCurrent = 0;
|
|
239
|
+
}
|
|
237
240
|
const tabRect = this.list[this.innerCurrent]
|
|
238
241
|
// 累加得到当前item到左边的距离
|
|
239
242
|
const offsetLeft = this.list
|
package/components/u-td/props.js
CHANGED
package/components/u-tr/props.js
CHANGED
package/index.js
CHANGED
|
@@ -77,7 +77,46 @@ const $u = {
|
|
|
77
77
|
platform
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
export const mount$u = function() {
|
|
81
|
+
uni.$u = $u
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// #ifdef H5
|
|
85
|
+
const importFn = import.meta.glob('./components/u-*/u-*.vue', { eager: true })
|
|
86
|
+
let components = [];
|
|
87
|
+
|
|
88
|
+
// 批量注册全局组件
|
|
89
|
+
for (const key in importFn) {
|
|
90
|
+
let component = importFn[key].default;
|
|
91
|
+
if (component.name && component.name.indexOf('u--') !== 0) {
|
|
92
|
+
const name = component.name.replace(/u-([a-zA-Z0-9-_]+)/g, 'up-$1');
|
|
93
|
+
component.name = name;
|
|
94
|
+
console.log('component', component.name)
|
|
95
|
+
component.install = function (Vue) {
|
|
96
|
+
Vue.component(component.name, component);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// 导入组件
|
|
100
|
+
components.push(component);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// #endif
|
|
104
|
+
|
|
105
|
+
function toCamelCase(str) {
|
|
106
|
+
return str.replace(/-([a-z])/g, function(match, group1) {
|
|
107
|
+
return group1.toUpperCase();
|
|
108
|
+
}).replace(/^[a-z]/, function(match) {
|
|
109
|
+
return match.toUpperCase();
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
80
113
|
const install = (Vue) => {
|
|
114
|
+
// #ifdef H5
|
|
115
|
+
components.forEach(function(component) {
|
|
116
|
+
Vue.component(component.name, component);
|
|
117
|
+
});
|
|
118
|
+
// #endif
|
|
119
|
+
|
|
81
120
|
// 同时挂载到uni和Vue.prototype中
|
|
82
121
|
// $u挂载到uni对象上
|
|
83
122
|
uni.$u = $u
|
package/libs/mixin/mixin.js
CHANGED
|
@@ -106,6 +106,9 @@ export const mixin = defineMixin({
|
|
|
106
106
|
// })
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
|
+
navTo(url = '', linkType = 'navigateTo') {
|
|
110
|
+
route({ type: this.linkType, url })
|
|
111
|
+
},
|
|
109
112
|
// 查询节点信息
|
|
110
113
|
// 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
|
|
111
114
|
// 解决办法为在组件根部再套一个没有任何作用的view元素
|