uview-plus 3.2.9 → 3.2.10

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 CHANGED
@@ -1,3 +1,8 @@
1
+ ## 3.2.10(2024-04-17)
2
+ 完善input清空事件App端失效的兼容性
3
+
4
+ 修复日历组件二次打开后当前月份显示不正确
5
+
1
6
  ## 3.2.9(2024-04-16)
2
7
  组件内uni.$u用法改为import引入
3
8
 
@@ -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
- this.setMonth()
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() {
@@ -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
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "uview-plus3.0重磅发布,全面的Vue3移动组件库。",
5
- "version": "3.2.9",
5
+ "version": "3.2.10",
6
6
  "description": "uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",
package/types/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /// <reference path="./comps.d.ts" />
2
2
  declare module 'uview-plus' {
3
3
  export function install(): void //必要
4
- export function route(): void //必要
5
4
  interface test {
6
5
  /** 邮箱格式校验 */
7
6
  email(email: string): boolean