uview-plus 3.1.38 → 3.1.40

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,10 @@
1
+ ## 3.1.40(2023-11-16)
2
+ 修复u-slider双向绑定
3
+ ## 3.1.39(2023-11-10)
4
+ 修复头条小程序不支持env(safe-area-inset-bottom)
5
+ 优化#201u-grid 指定列数导致闪烁
6
+ #193IndexList 索引列表 高度错误
7
+ 其他优化
1
8
  ## 3.1.38(2023-10-08)
2
9
  修复u-slider
3
10
  ## 3.1.37(2023-09-13)
@@ -5,6 +5,11 @@ export default {
5
5
  show: {
6
6
  type: Boolean,
7
7
  default: defprops.datetimePicker.show
8
+ },
9
+ // 弹出的方向,可选值为 top bottom right left center
10
+ popupMode: {
11
+ type: String,
12
+ default: defprops.picker.popupMode
8
13
  },
9
14
  // 是否展示顶部的操作栏
10
15
  showToolbar: {
@@ -2,6 +2,7 @@
2
2
  <u-picker
3
3
  ref="picker"
4
4
  :show="show"
5
+ :popupMode="popupMode"
5
6
  :closeOnClickOverlay="closeOnClickOverlay"
6
7
  :columns="columns"
7
8
  :title="title"
@@ -84,6 +85,16 @@
84
85
  this.updateColumnValue(this.innerValue)
85
86
  }
86
87
  },
88
+ // #ifdef VUE3
89
+ modelValue(newValue) {
90
+ this.init()
91
+ },
92
+ // #endif
93
+ // #ifdef VUE2
94
+ value(newValue) {
95
+ this.init()
96
+ },
97
+ // #endif
87
98
  propsChange() {
88
99
  this.init()
89
100
  }
@@ -198,8 +209,12 @@
198
209
  // 更新各列的值,进行补0、格式化等操作
199
210
  updateColumnValue(value) {
200
211
  this.innerValue = value
201
- this.updateColumns()
202
- this.updateIndexs(value)
212
+ this.updateColumns()
213
+ // 延迟执行,等待u-picker组件列数据更新完后再设置选中值索引
214
+ setTimeout(() => {
215
+ this.updateIndexs(value)
216
+ }, 0);
217
+
203
218
  },
204
219
  // 更新索引
205
220
  updateIndexs(value) {
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <!-- #ifndef APP-NVUE -->
3
3
  <view
4
+ v-if="parentData.col > 0"
4
5
  class="u-grid-item"
5
6
  hover-class="u-grid-item--hover-class"
6
7
  :hover-stay-time="200"
@@ -44,7 +45,7 @@
44
45
  data() {
45
46
  return {
46
47
  parentData: {
47
- col: 3, // 父组件划分的宫格数
48
+ col: 0, // 父组件划分的宫格数
48
49
  border: true, // 是否显示边框,根据父组件决定
49
50
  },
50
51
  // #ifdef APP-NVUE
@@ -65,7 +66,11 @@
65
66
  // #ifndef APP-NVUE
66
67
  // vue下放到computed中,否则会因为延时造成闪烁
67
68
  width() {
68
- return 100 / Number(this.parentData.col) + '%'
69
+ if (this.parentData.col > 0) {
70
+ return 100 / Number(this.parentData.col) + '%'
71
+ } else {
72
+ return 0;
73
+ }
69
74
  },
70
75
  // #endif
71
76
  itemStyle() {
@@ -191,7 +191,8 @@
191
191
  // 设置列表的高度为整个屏幕的高度
192
192
  //减去this.customNavHeight,并将this.scrollViewHeight设置为maxHeight
193
193
  //解决当u-index-list组件放在tabbar页面时,scroll-view内容较少时,还能滚动
194
- this.scrollViewHeight = this.sys.windowHeight - this.customNavHeight
194
+ let customNavHeight = uni.$u.getPx(this.customNavHeight)
195
+ this.scrollViewHeight = this.sys.windowHeight - customNavHeight
195
196
  },
196
197
  // 索引列表被触摸
197
198
  touchStart(e) {
@@ -5,6 +5,11 @@ export default {
5
5
  show: {
6
6
  type: Boolean,
7
7
  default: defprops.picker.show
8
+ },
9
+ // 弹出的方向,可选值为 top bottom right left center
10
+ popupMode: {
11
+ type: String,
12
+ default: defprops.picker.popupMode
8
13
  },
9
14
  // 是否展示顶部的操作栏
10
15
  showToolbar: {
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <u-popup
3
3
  :show="show"
4
+ :mode="popupMode"
4
5
  @close="closeHandler"
5
6
  >
6
7
  <view class="u-picker">
@@ -18,7 +19,7 @@
18
19
  class="u-picker__view"
19
20
  :indicatorStyle="`height: ${$u.addUnit(itemHeight)}`"
20
21
  :value="innerIndex"
21
- :immediateChange="immediateChange"
22
+ :immediateChange="true"
22
23
  :style="{
23
24
  height: `${$u.addUnit(visibleItemCount * itemHeight)}`
24
25
  }"
@@ -33,7 +33,7 @@
33
33
  computed: {
34
34
  style() {
35
35
  const style = {};
36
- // #ifdef APP-NVUE
36
+ // #ifdef APP-NVUE || MP-TOUTIAO
37
37
  // nvue下,高度使用js计算填充
38
38
  style.height = uni.$u.addUnit(uni.$u.sys().safeAreaInsets.bottom, 'px');
39
39
  // #endif
@@ -7,7 +7,7 @@
7
7
  :min="min"
8
8
  :max="max"
9
9
  :step="step"
10
- :value="value"
10
+ :value="modelValue"
11
11
  :activeColor="activeColor"
12
12
  :backgroundColor="inactiveColor"
13
13
  :blockSize="$u.getPx(blockSize)"
@@ -27,7 +27,7 @@
27
27
  export default {
28
28
  name: 'u--slider',
29
29
  mixins: [mpMixin, mixin, props],
30
- emits: ["changing", "change"],
30
+ emits: ["changing", "change", "update:modelValue"],
31
31
  methods: {
32
32
  // 拖动过程中触发
33
33
  changingHandler(e) {
@@ -11,6 +11,7 @@ export default {
11
11
  // datetimePicker 组件
12
12
  datetimePicker: {
13
13
  show: false,
14
+ popupMode: 'bottom',
14
15
  showToolbar: true,
15
16
  value: '',
16
17
  title: '',
@@ -11,6 +11,7 @@ export default {
11
11
  // picker
12
12
  picker: {
13
13
  show: false,
14
+ popupMode: 'bottom',
14
15
  showToolbar: true,
15
16
  title: '',
16
17
  columns: () => [],
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.1.38",
5
+ "version": "3.1.40",
6
6
  "description": "uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",