uview-plus 3.2.16 → 3.2.18
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 +14 -0
- package/components/u-action-sheet/u-action-sheet.vue +2 -1
- package/components/u-index-list/u-index-list.vue +1 -0
- package/components/u-list/props.js +26 -3
- package/components/u-list/u-list.vue +24 -1
- package/components/u-parse/u-parse.vue +6 -5
- package/components/u-picker/u-picker.vue +2 -2
- package/components/u-popup/u-popup.vue +1 -0
- package/components/u-qrcode/u-qrcode.vue +1 -1
- package/components/u-scroll-list/nvue.js +4 -1
- package/components/u-search/props.js +10 -0
- package/components/u-search/u-search.vue +4 -0
- package/components/u-tabs/u-tabs.vue +3 -2
- package/libs/config/props/picker.js +1 -1
- package/libs/mixin/mixin.js +3 -2
- package/package.json +1 -1
- package/types/comps/tabs.d.ts +4 -4
package/changelog.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 3.2.18(2024-05-09)
|
|
2
|
+
fix: 349 popup 组件设置 zIndex 属性后,组件渲染异常#
|
|
3
|
+
feat: 搜索框增加adjustPosition属性
|
|
4
|
+
fix: #331增加u-action-sheet__cancel
|
|
5
|
+
优化mixin兼容性
|
|
6
|
+
feat: #326 up-list增加下拉刷新功能
|
|
7
|
+
fix: #319 优化up-tabs参数与定义匹配
|
|
8
|
+
fix: index-list组件微信小程序端使用自定义导航栏异常
|
|
9
|
+
fix: #285 pickerimmediateChange 写死为true
|
|
10
|
+
fix: #111 u-scroll-list组件,隐藏指示器后报错, 提示找不到ref
|
|
11
|
+
list增加微信小程序防抖配置
|
|
12
|
+
|
|
13
|
+
## 3.2.17(2024-05-08)
|
|
14
|
+
fix: 支付宝小程序二维码渲染
|
|
1
15
|
## 3.2.16(2024-05-06)
|
|
2
16
|
修复tabs中,当前激活样式的undefined bug
|
|
3
17
|
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
height="6"
|
|
93
93
|
v-if="cancelText"
|
|
94
94
|
></u-gap>
|
|
95
|
-
<view
|
|
95
|
+
<view class="u-action-sheet__item-wrap__item u-action-sheet__cancel"
|
|
96
|
+
hover-class="u-action-sheet--hover">
|
|
96
97
|
<text
|
|
97
98
|
@touchmove.stop.prevent
|
|
98
99
|
:hover-stay-time="150"
|
|
@@ -70,8 +70,31 @@ export default {
|
|
|
70
70
|
preLoadScreen: {
|
|
71
71
|
type: [String, Number],
|
|
72
72
|
default: () => defProps.list.preLoadScreen
|
|
73
|
-
}
|
|
74
|
-
//
|
|
75
|
-
|
|
73
|
+
},
|
|
74
|
+
// 开启自定义下拉刷新
|
|
75
|
+
refresherEnabled: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: () => false
|
|
78
|
+
},
|
|
79
|
+
// 设置自定义下拉刷新阈值
|
|
80
|
+
refresherThreshold: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: () => 45
|
|
83
|
+
},
|
|
84
|
+
// 设置自定义下拉刷新默认样式,支持设置 black,white,none,none 表示不使用默认样式
|
|
85
|
+
refresherDefaultStyle: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: () => 'black'
|
|
88
|
+
},
|
|
89
|
+
// 设置自定义下拉刷新区域背景颜色
|
|
90
|
+
refresherBackground: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: () => '#FFF'
|
|
93
|
+
},
|
|
94
|
+
// 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
|
|
95
|
+
refresherTriggered: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: () => false
|
|
98
|
+
},
|
|
76
99
|
}
|
|
77
100
|
}
|
|
@@ -28,6 +28,16 @@
|
|
|
28
28
|
@scroll="onScroll"
|
|
29
29
|
@scrolltolower="scrolltolower"
|
|
30
30
|
@scrolltoupper="scrolltoupper"
|
|
31
|
+
:refresher-enabled="refresherEnabled"
|
|
32
|
+
:refresher-threshold="refresherThreshold"
|
|
33
|
+
:refresher-default-style="refresherDefaultStyle"
|
|
34
|
+
:refresher-background="refresherBackground"
|
|
35
|
+
:refresher-triggered="refresherTriggered"
|
|
36
|
+
@refresherpulling="refresherpulling"
|
|
37
|
+
@refresherrefresh="refresherrefresh"
|
|
38
|
+
@refresherrestore="refresherrestore"
|
|
39
|
+
@refresherabort="refresherabort"
|
|
40
|
+
:scroll-anchoring="true"
|
|
31
41
|
>
|
|
32
42
|
<view>
|
|
33
43
|
<slot />
|
|
@@ -104,7 +114,8 @@
|
|
|
104
114
|
this.anchors = []
|
|
105
115
|
},
|
|
106
116
|
mounted() {},
|
|
107
|
-
emits: ["scroll", "scrolltolower", "scrolltoupper"
|
|
117
|
+
emits: ["scroll", "scrolltolower", "scrolltoupper",
|
|
118
|
+
"refresherpulling", "refresherrefresh", "refresherrestore", "refresherabort"],
|
|
108
119
|
methods: {
|
|
109
120
|
updateOffsetFromChild(top) {
|
|
110
121
|
this.offset = top
|
|
@@ -144,6 +155,18 @@
|
|
|
144
155
|
// 这一句很重要,能绝对保证在性功能障碍的webview,滚动条到顶时,取消偏移值,让页面置顶
|
|
145
156
|
this.offset = 0
|
|
146
157
|
})
|
|
158
|
+
},
|
|
159
|
+
refresherpulling(e) {
|
|
160
|
+
this.$emit('refresherpulling', e)
|
|
161
|
+
},
|
|
162
|
+
refresherrefresh(e) {
|
|
163
|
+
this.$emit('refresherrefresh', e)
|
|
164
|
+
},
|
|
165
|
+
refresherrestore(e) {
|
|
166
|
+
this.$emit('refresherrestore', e)
|
|
167
|
+
},
|
|
168
|
+
refresherabort(e) {
|
|
169
|
+
this.$emit('refresherabort', e)
|
|
147
170
|
}
|
|
148
171
|
// #endif
|
|
149
172
|
},
|
|
@@ -127,11 +127,12 @@ export default {
|
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
// #ifdef VUE2
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
// beforeDestroy()
|
|
131
|
+
// #endif
|
|
132
|
+
// #ifdef VUE3
|
|
133
|
+
beforeUnmount()
|
|
134
|
+
// #endif
|
|
135
|
+
{
|
|
135
136
|
this._hook('onDetached')
|
|
136
137
|
},
|
|
137
138
|
methods: {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
class="u-picker__view"
|
|
20
20
|
:indicatorStyle="`height: ${addUnit(itemHeight)}`"
|
|
21
21
|
:value="innerIndex"
|
|
22
|
-
:immediateChange="
|
|
22
|
+
:immediateChange="immediateChange"
|
|
23
23
|
:style="{
|
|
24
24
|
height: `${addUnit(visibleItemCount * itemHeight)}`
|
|
25
25
|
}"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
* @property {String} keyName 选项对象中,需要展示的属性键名(默认 'text' )
|
|
73
73
|
* @property {Boolean} closeOnClickOverlay 是否允许点击遮罩关闭选择器(默认 false )
|
|
74
74
|
* @property {Array} defaultIndex 各列的默认索引
|
|
75
|
-
* @property {Boolean} immediateChange 是否在手指松开时立即触发change事件(默认
|
|
75
|
+
* @property {Boolean} immediateChange 是否在手指松开时立即触发change事件(默认 true )
|
|
76
76
|
* @event {Function} close 关闭选择器时触发
|
|
77
77
|
* @event {Function} cancel 点击取消按钮触发
|
|
78
78
|
* @event {Function} change 当选择值变化时触发
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="u-qrcode">
|
|
3
|
-
<canvas class="u-qrcode__canvas" :canvas-id="cid" :style="{ width: size + unit, height: size + unit }" />
|
|
3
|
+
<canvas class="u-qrcode__canvas" :id="cid" :canvas-id="cid" :style="{ width: size + unit, height: size + unit }" />
|
|
4
4
|
<image v-show="show" :src="result" :style="{ width: size + unit, height: size + unit }" />
|
|
5
5
|
</view>
|
|
6
6
|
</template>
|
|
@@ -6,7 +6,10 @@ export default {
|
|
|
6
6
|
// 此处不写注释,请自行体会
|
|
7
7
|
nvueScrollHandler(e) {
|
|
8
8
|
const anchor = this.$refs['u-scroll-list__scroll-view'].ref
|
|
9
|
-
const element =
|
|
9
|
+
const element = {}
|
|
10
|
+
if (this.$refs['u-scroll-list__indicator__line__bar']) {
|
|
11
|
+
element = this.$refs['u-scroll-list__indicator__line__bar'].ref
|
|
12
|
+
}
|
|
10
13
|
const scrollLeft = e.contentOffset.x
|
|
11
14
|
const contentSize = e.contentSize.width
|
|
12
15
|
const { scrollWidth } = this
|
|
@@ -118,6 +118,16 @@ export default {
|
|
|
118
118
|
label: {
|
|
119
119
|
type: [String, Number, null],
|
|
120
120
|
default: () => defProps.search.label
|
|
121
|
+
},
|
|
122
|
+
// 键盘弹起时,是否自动上推页面
|
|
123
|
+
adjustPosition: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: () => true
|
|
126
|
+
},
|
|
127
|
+
// 键盘收起时,是否自动失去焦点
|
|
128
|
+
autoBlur: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
default: () => false
|
|
121
131
|
}
|
|
122
132
|
}
|
|
123
133
|
}
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
@focus="getFocus"
|
|
38
38
|
:focus="focus"
|
|
39
39
|
:maxlength="maxlength"
|
|
40
|
+
:adjust-position="adjustPosition"
|
|
41
|
+
:auto-blur="autoBlur"
|
|
40
42
|
placeholder-class="u-search__content__input--placeholder"
|
|
41
43
|
:placeholder="placeholder"
|
|
42
44
|
:placeholder-style="`color: ${placeholderColor}`"
|
|
@@ -103,6 +105,8 @@
|
|
|
103
105
|
* @property {String | Number} maxlength 输入框最大能输入的长度,-1为不限制长度 (默认 '-1' )
|
|
104
106
|
* @property {String | Number} height 输入框高度,单位px(默认 64 )
|
|
105
107
|
* @property {String | Number} label 搜索框左边显示内容
|
|
108
|
+
* @property {Boolean} adjustPosition 键盘弹起时,是否自动上推页面
|
|
109
|
+
* @property {Boolean} autoBlur 键盘收起时,是否自动失去焦点
|
|
106
110
|
* @property {Object} customStyle 定义需要用到的外部样式
|
|
107
111
|
*
|
|
108
112
|
* @event {Function} change 输入框内容发生变化时触发
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
import mixin from '../../libs/mixin/mixin';
|
|
91
91
|
import defProps from '../../libs/config/props.js';
|
|
92
92
|
import { addUnit, addStyle, deepMerge, getPx, sleep, sys } from '../../libs/function/index';
|
|
93
|
+
import Index from '@/pages/template/login/index.vue';
|
|
93
94
|
/**
|
|
94
95
|
* Tabs 标签
|
|
95
96
|
* @description tabs标签组件,在标签多的时候,可以配置为左右滑动,标签少的时候,可以禁止滑动。 该组件的一个特点是配置为滚动模式时,激活的tab会自动移动到组件的中间位置。
|
|
@@ -204,7 +205,7 @@
|
|
|
204
205
|
this.$emit('click', {
|
|
205
206
|
...item,
|
|
206
207
|
index
|
|
207
|
-
})
|
|
208
|
+
}, index)
|
|
208
209
|
// 如果disabled状态,返回
|
|
209
210
|
if (item.disabled) return
|
|
210
211
|
this.innerCurrent = index
|
|
@@ -212,7 +213,7 @@
|
|
|
212
213
|
this.$emit('change', {
|
|
213
214
|
...item,
|
|
214
215
|
index
|
|
215
|
-
})
|
|
216
|
+
}, index)
|
|
216
217
|
},
|
|
217
218
|
init() {
|
|
218
219
|
sleep().then(() => {
|
package/libs/mixin/mixin.js
CHANGED
|
@@ -150,11 +150,12 @@ export default {
|
|
|
150
150
|
uni.$emit('uOnReachBottom')
|
|
151
151
|
},
|
|
152
152
|
// #ifdef VUE2
|
|
153
|
-
beforeDestroy()
|
|
153
|
+
// beforeDestroy()
|
|
154
154
|
// #endif
|
|
155
155
|
// #ifdef VUE3
|
|
156
|
-
beforeUnmount()
|
|
156
|
+
beforeUnmount()
|
|
157
157
|
// #endif
|
|
158
|
+
{
|
|
158
159
|
// 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
|
|
159
160
|
// 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
|
|
160
161
|
if (this.parent && test.array(this.parent.children)) {
|
package/package.json
CHANGED
package/types/comps/tabs.d.ts
CHANGED
|
@@ -62,16 +62,16 @@ declare interface TabsProps {
|
|
|
62
62
|
keyName?: string
|
|
63
63
|
/**
|
|
64
64
|
* 点击标签时触发
|
|
65
|
-
* @param index 标签索引值
|
|
66
65
|
* @param item 传入的其他值
|
|
66
|
+
* @param index 标签索引值
|
|
67
67
|
*/
|
|
68
|
-
onClick?: (
|
|
68
|
+
onClick?: (item: any, index: number) => any
|
|
69
69
|
/**
|
|
70
70
|
* 标签索引改变时触发(`disalbed`时不会触发)
|
|
71
|
-
* @param index 标签索引值
|
|
72
71
|
* @param item 传入的其他值
|
|
72
|
+
* @param index 标签索引值
|
|
73
73
|
*/
|
|
74
|
-
onChange?: (
|
|
74
|
+
onChange?: (item: any, index: number) => any
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
declare interface _Tabs {
|