uview-plus 3.2.17 → 3.2.19

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,17 @@
1
+ ## 3.2.19(2024-05-10)
2
+ 去除意外的文件引入
3
+ ## 3.2.18(2024-05-09)
4
+ fix: 349 popup 组件设置 zIndex 属性后,组件渲染异常#
5
+ feat: 搜索框增加adjustPosition属性
6
+ fix: #331增加u-action-sheet__cancel
7
+ 优化mixin兼容性
8
+ feat: #326 up-list增加下拉刷新功能
9
+ fix: #319 优化up-tabs参数与定义匹配
10
+ fix: index-list组件微信小程序端使用自定义导航栏异常
11
+ fix: #285 pickerimmediateChange 写死为true
12
+ fix: #111 u-scroll-list组件,隐藏指示器后报错, 提示找不到ref
13
+ list增加微信小程序防抖配置
14
+
1
15
  ## 3.2.17(2024-05-08)
2
16
  fix: 支付宝小程序二维码渲染
3
17
  ## 3.2.16(2024-05-06)
@@ -92,7 +92,8 @@
92
92
  height="6"
93
93
  v-if="cancelText"
94
94
  ></u-gap>
95
- <view hover-class="u-action-sheet--hover">
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"
@@ -113,7 +113,7 @@
113
113
  },
114
114
  mounted() {
115
115
  this.init()
116
- console.log('$slots', this.$slots)
116
+ // console.log('$slots', this.$slots)
117
117
  },
118
118
  methods: {
119
119
  // 异步获取内容,或者动态修改了内容时,需要重新初始化
@@ -366,6 +366,7 @@
366
366
  // 非nvue通过detail获取滚动条位移
367
367
  scrollTop = e.detail.scrollTop
368
368
  // #endif
369
+ scrollTop += getPx(this.customNavHeight)
369
370
  for (let i = 0; i < len; i++) {
370
371
  const item = children[i],
371
372
  nextItem = children[i + 1]
@@ -70,8 +70,31 @@ export default {
70
70
  preLoadScreen: {
71
71
  type: [String, Number],
72
72
  default: () => defProps.list.preLoadScreen
73
- }
74
- // vue下,是否开启虚拟列表
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
- beforeDestroy() {
131
- // #endif
132
- // #ifdef VUE3
133
- beforeUnmount() {
134
- // #endif
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="true"
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事件(默认 false
75
+ * @property {Boolean} immediateChange 是否在手指松开时立即触发change事件(默认 true
76
76
  * @event {Function} close 关闭选择器时触发
77
77
  * @event {Function} cancel 点击取消按钮触发
78
78
  * @event {Function} change 当选择值变化时触发
@@ -4,6 +4,7 @@
4
4
  :show="show"
5
5
  @click="overlayClick"
6
6
  v-if="overlay"
7
+ :zIndex="zIndex"
7
8
  :duration="overlayDuration"
8
9
  :customStyle="overlayStyle"
9
10
  :opacity="overlayOpacity"
@@ -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 = this.$refs['u-scroll-list__indicator__line__bar'].ref
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 输入框内容发生变化时触发
@@ -204,7 +204,7 @@
204
204
  this.$emit('click', {
205
205
  ...item,
206
206
  index
207
- })
207
+ }, index)
208
208
  // 如果disabled状态,返回
209
209
  if (item.disabled) return
210
210
  this.innerCurrent = index
@@ -212,7 +212,7 @@
212
212
  this.$emit('change', {
213
213
  ...item,
214
214
  index
215
- })
215
+ }, index)
216
216
  },
217
217
  init() {
218
218
  sleep().then(() => {
@@ -25,6 +25,6 @@ export default {
25
25
  keyName: 'text',
26
26
  closeOnClickOverlay: false,
27
27
  defaultIndex: [],
28
- immediateChange: false
28
+ immediateChange: true
29
29
  }
30
30
  }
@@ -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
@@ -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.17",
5
+ "version": "3.2.19",
6
6
  "description": "uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",
@@ -52,7 +52,7 @@ declare interface _FormRef {
52
52
  /**
53
53
  * 对部分表单字段进行校验
54
54
  */
55
- validateField: (value, cb: ((errorsRes) => any)) => any
55
+ validateField: (value, cb?: ((errorsRes) => any)) => any
56
56
  /**
57
57
  * 对整个表单进行重置,将所有字段值重置为初始值并移除校验结果
58
58
  */
@@ -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?: (index: number, item: any) => any
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?: (index: number, item: any) => any
74
+ onChange?: (item: any, index: number) => any
75
75
  }
76
76
 
77
77
  declare interface _Tabs {