uview-plus 3.2.9 → 3.2.11
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 +7 -0
- package/components/u-calendar/u-calendar.vue +16 -2
- package/components/u-datetime-picker/u-datetime-picker.vue +6 -7
- package/components/u-index-list/u-index-list.vue +4 -4
- package/components/u-input/u-input.vue +7 -1
- package/components/u-safe-bottom/u-safe-bottom.vue +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +0 -1
package/changelog.md
CHANGED
|
@@ -130,12 +130,19 @@ export default {
|
|
|
130
130
|
// month组件中选择的日期数组
|
|
131
131
|
selected: [],
|
|
132
132
|
scrollIntoView: '',
|
|
133
|
+
scrollIntoViewScroll: '',
|
|
133
134
|
scrollTop:0,
|
|
134
135
|
// 过滤处理方法
|
|
135
136
|
innerFormatter: (value) => value
|
|
136
137
|
}
|
|
137
138
|
},
|
|
138
139
|
watch: {
|
|
140
|
+
scrollIntoView: {
|
|
141
|
+
immediate: true,
|
|
142
|
+
handler(n) {
|
|
143
|
+
// console.log('scrollIntoView', n)
|
|
144
|
+
}
|
|
145
|
+
},
|
|
139
146
|
selectedChange: {
|
|
140
147
|
immediate: true,
|
|
141
148
|
handler(n) {
|
|
@@ -146,7 +153,13 @@ export default {
|
|
|
146
153
|
show: {
|
|
147
154
|
immediate: true,
|
|
148
155
|
handler(n) {
|
|
149
|
-
|
|
156
|
+
if (n) {
|
|
157
|
+
this.setMonth()
|
|
158
|
+
} else {
|
|
159
|
+
// 关闭时重置scrollIntoView,否则会出现二次打开日历,当前月份数据显示不正确。
|
|
160
|
+
// scrollIntoView需要有一个值变动过程,才会产生作用。
|
|
161
|
+
this.scrollIntoView = ''
|
|
162
|
+
}
|
|
150
163
|
}
|
|
151
164
|
}
|
|
152
165
|
},
|
|
@@ -323,7 +336,6 @@ export default {
|
|
|
323
336
|
year: dayjs(minDate).add(i, 'month').year()
|
|
324
337
|
})
|
|
325
338
|
}
|
|
326
|
-
|
|
327
339
|
},
|
|
328
340
|
// 滚动到默认设置的月份
|
|
329
341
|
scrollIntoDefaultMonth(selected) {
|
|
@@ -339,6 +351,7 @@ export default {
|
|
|
339
351
|
// #ifndef MP-WEIXIN
|
|
340
352
|
this.$nextTick(() => {
|
|
341
353
|
this.scrollIntoView = `month-${_index}`
|
|
354
|
+
this.scrollIntoViewScroll = this.scrollIntoView
|
|
342
355
|
})
|
|
343
356
|
// #endif
|
|
344
357
|
// #ifdef MP-WEIXIN
|
|
@@ -354,6 +367,7 @@ export default {
|
|
|
354
367
|
for (let i = 0; i < this.months.length; i++) {
|
|
355
368
|
if (scrollTop >= (this.months[i].top || this.listHeight)) {
|
|
356
369
|
this.monthIndex = i
|
|
370
|
+
this.scrollIntoViewScroll = `month-${i}`
|
|
357
371
|
}
|
|
358
372
|
}
|
|
359
373
|
},
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
// #ifdef VUE2
|
|
106
106
|
value(newValue) {
|
|
107
107
|
this.init()
|
|
108
|
+
this.getInputValue()
|
|
108
109
|
},
|
|
109
110
|
// #endif
|
|
110
111
|
propsChange() {
|
|
@@ -257,18 +258,16 @@
|
|
|
257
258
|
// 更新各列的值,进行补0、格式化等操作
|
|
258
259
|
updateColumnValue(value) {
|
|
259
260
|
this.innerValue = value
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
261
|
+
this.updateColumns()
|
|
262
|
+
// 延迟执行,等待u-picker组件列数据更新完后再设置选中值索引
|
|
263
|
+
setTimeout(() => {
|
|
264
|
+
this.updateIndexs(value)
|
|
265
|
+
}, 0);
|
|
266
266
|
},
|
|
267
267
|
// 更新索引
|
|
268
268
|
updateIndexs(value) {
|
|
269
269
|
let values = []
|
|
270
270
|
const formatter = this.formatter || this.innerFormatter
|
|
271
|
-
const padZero = padZero
|
|
272
271
|
if (this.mode === 'time') {
|
|
273
272
|
// 将time模式的时间用:分隔成数组
|
|
274
273
|
const timeArr = value.split(':')
|
|
@@ -256,17 +256,17 @@
|
|
|
256
256
|
const {
|
|
257
257
|
height
|
|
258
258
|
} = size
|
|
259
|
-
const
|
|
260
|
-
const windowHeight =
|
|
259
|
+
const sysData = sys()
|
|
260
|
+
const windowHeight = sysData.windowHeight
|
|
261
261
|
let customNavHeight = 0
|
|
262
262
|
// 消除各端导航栏非原生和原生导致的差异,让索引列表字母对屏幕垂直居中
|
|
263
263
|
if (this.customNavHeight == 0) {
|
|
264
264
|
// #ifdef H5
|
|
265
|
-
customNavHeight =
|
|
265
|
+
customNavHeight = sysData.windowTop
|
|
266
266
|
// #endif
|
|
267
267
|
// #ifndef H5
|
|
268
268
|
// 在非H5中,为原生导航栏,其高度不算在windowHeight内,这里设置为负值,后面相加时变成减去其高度的一半
|
|
269
|
-
customNavHeight = -(
|
|
269
|
+
customNavHeight = -(sysData.statusBarHeight + 44)
|
|
270
270
|
// #endif
|
|
271
271
|
} else {
|
|
272
272
|
customNavHeight = getPx(this.customNavHeight)
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
@focus="onFocus"
|
|
45
45
|
@confirm="onConfirm"
|
|
46
46
|
@keyboardheightchange="onkeyboardheightchange"
|
|
47
|
-
@change="onInput"
|
|
48
47
|
/>
|
|
49
48
|
</view>
|
|
50
49
|
<view
|
|
@@ -127,6 +126,8 @@ export default {
|
|
|
127
126
|
mixins: [mpMixin, mixin, props],
|
|
128
127
|
data() {
|
|
129
128
|
return {
|
|
129
|
+
// 清除操作
|
|
130
|
+
clearInput: false,
|
|
130
131
|
// 输入框的值
|
|
131
132
|
innerValue: "",
|
|
132
133
|
// 是否处于获得焦点状态
|
|
@@ -284,6 +285,10 @@ export default {
|
|
|
284
285
|
},
|
|
285
286
|
// 内容发生变化,进行处理
|
|
286
287
|
valueChange() {
|
|
288
|
+
if(this.clearInput) {
|
|
289
|
+
this.innerValue = '';
|
|
290
|
+
this.clearInput = false;
|
|
291
|
+
}
|
|
287
292
|
const value = this.innerValue;
|
|
288
293
|
this.$nextTick(() => {
|
|
289
294
|
// #ifdef VUE3
|
|
@@ -301,6 +306,7 @@ export default {
|
|
|
301
306
|
},
|
|
302
307
|
// 点击清除控件
|
|
303
308
|
onClear() {
|
|
309
|
+
this.clearInput = true;
|
|
304
310
|
this.innerValue = "";
|
|
305
311
|
this.$nextTick(() => {
|
|
306
312
|
this.valueChange();
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import props from "./props.js";
|
|
12
12
|
import mpMixin from '../../libs/mixin/mpMixin';
|
|
13
13
|
import mixin from '../../libs/mixin/mixin';
|
|
14
|
-
import { addUnit, sys } from '../../libs/function/index';
|
|
14
|
+
import { addStyle, deepMerge, addUnit, sys } from '../../libs/function/index';
|
|
15
15
|
/**
|
|
16
16
|
* SafeBottom 底部安全区
|
|
17
17
|
* @description 这个适配,主要是针对IPhone X等一些底部带指示条的机型,指示条的操作区域与页面底部存在重合,容易导致用户误操作,因此我们需要针对这些机型进行底部安全区适配。
|
package/package.json
CHANGED