uview-plus 3.1.52 → 3.2.5

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.
Files changed (134) hide show
  1. package/changelog.md +51 -0
  2. package/components/u-action-sheet/u-action-sheet.vue +1 -1
  3. package/components/u-album/u-album.vue +261 -261
  4. package/components/u-avatar/u-avatar.vue +3 -2
  5. package/components/u-avatar-group/u-avatar-group.vue +106 -106
  6. package/components/u-button/u-button.vue +6 -1
  7. package/components/u-calendar/u-calendar.vue +4 -3
  8. package/components/u-cell/u-cell.vue +4 -2
  9. package/components/u-checkbox/props.js +5 -0
  10. package/components/u-checkbox/u-checkbox.vue +29 -17
  11. package/components/u-code/u-code.vue +1 -1
  12. package/components/u-dropdown/props.js +8 -14
  13. package/components/u-dropdown/u-dropdown.vue +202 -77
  14. package/components/u-dropdown-item/props.js +45 -36
  15. package/components/u-dropdown-item/u-dropdown-item.vue +121 -148
  16. package/components/u-form/u-form.vue +1 -1
  17. package/components/u-form-item/props.js +6 -1
  18. package/components/u-form-item/u-form-item.vue +1 -1
  19. package/components/u-grid/u-grid.vue +4 -2
  20. package/components/u-grid-item/u-grid-item.vue +8 -7
  21. package/components/u-input/u-input.vue +1 -1
  22. package/components/u-lazy-load/u-lazy-load.vue +251 -0
  23. package/components/u-number-box/u-number-box.vue +4 -4
  24. package/components/u-picker/u-picker.vue +5 -2
  25. package/components/u-popup/u-popup.vue +1 -1
  26. package/components/u-radio/u-radio.vue +2 -2
  27. package/components/u-rate/u-rate.vue +1 -1
  28. package/components/u-read-more/u-read-more.vue +164 -160
  29. package/components/u-slider/u-slider.vue +6 -6
  30. package/components/u-steps-item/u-steps-item.vue +318 -318
  31. package/components/u-subsection/u-subsection.vue +35 -21
  32. package/components/u-swiper/u-swiper.vue +6 -8
  33. package/components/u-switch/u-switch.vue +1 -1
  34. package/components/u-tabbar-item/u-tabbar-item.vue +1 -1
  35. package/components/u-tabs/u-tabs.vue +1 -0
  36. package/components/u-tag/props.js +5 -2
  37. package/components/u-tag/u-tag.vue +1 -1
  38. package/components/u-text/u-text.vue +226 -226
  39. package/components/u-textarea/u-textarea.vue +275 -275
  40. package/components/u-transition/u-transition.vue +1 -1
  41. package/components/u-waterfall/u-waterfall.vue +225 -0
  42. package/index.js +5 -2
  43. package/libs/config/props/formItem.js +1 -0
  44. package/libs/config/props/tag.js +30 -29
  45. package/libs/css/common.scss +4 -1
  46. package/libs/css/components.scss +5 -5
  47. package/libs/css/flex.scss +45 -45
  48. package/libs/mixin/mixin.js +2 -2
  49. package/libs/mixin/mpShare.js +15 -13
  50. package/package.json +1 -1
  51. package/types/comps/_common.d.ts +9 -0
  52. package/types/comps/actionSheet.d.ts +121 -0
  53. package/types/comps/album.d.ts +72 -0
  54. package/types/comps/alert.d.ts +55 -0
  55. package/types/comps/avatar.d.ts +85 -0
  56. package/types/comps/avatarGroup.d.ts +62 -0
  57. package/types/comps/backTop.d.ts +74 -0
  58. package/types/comps/badge.d.ts +76 -0
  59. package/types/comps/button.d.ts +169 -0
  60. package/types/comps/calendar.d.ts +164 -0
  61. package/types/comps/cell.d.ts +133 -0
  62. package/types/comps/cellGroup.d.ts +27 -0
  63. package/types/comps/checkbox.d.ts +69 -0
  64. package/types/comps/checkboxGroup.d.ts +93 -0
  65. package/types/comps/code.d.ts +69 -0
  66. package/types/comps/codeInput.d.ts +98 -0
  67. package/types/comps/col.d.ts +43 -0
  68. package/types/comps/collapse.d.ts +52 -0
  69. package/types/comps/collapseItem.d.ts +83 -0
  70. package/types/comps/countDown.d.ts +60 -0
  71. package/types/comps/countTo.d.ts +88 -0
  72. package/types/comps/datetimePicker.d.ts +146 -0
  73. package/types/comps/divider.d.ts +58 -0
  74. package/types/comps/empty.d.ts +72 -0
  75. package/types/comps/form.d.ts +76 -0
  76. package/types/comps/formItem.d.ts +68 -0
  77. package/types/comps/gap.d.ts +35 -0
  78. package/types/comps/grid.d.ts +34 -0
  79. package/types/comps/gridItem.d.ts +28 -0
  80. package/types/comps/icon.d.ts +93 -0
  81. package/types/comps/image.d.ts +119 -0
  82. package/types/comps/indexAnchor.d.ts +38 -0
  83. package/types/comps/indexItem.d.ts +18 -0
  84. package/types/comps/indexList.d.ts +39 -0
  85. package/types/comps/input.d.ts +234 -0
  86. package/types/comps/keyboard.d.ts +125 -0
  87. package/types/comps/line.d.ts +44 -0
  88. package/types/comps/lineProgress.d.ts +51 -0
  89. package/types/comps/link.d.ts +51 -0
  90. package/types/comps/list.d.ts +92 -0
  91. package/types/comps/listItem.d.ts +18 -0
  92. package/types/comps/loadMore.d.ts +108 -0
  93. package/types/comps/loadingIcon.d.ts +68 -0
  94. package/types/comps/loadingPage.d.ts +58 -0
  95. package/types/comps/modal.d.ts +115 -0
  96. package/types/comps/navbar.d.ts +113 -0
  97. package/types/comps/noNetwork.d.ts +40 -0
  98. package/types/comps/noticeBar.d.ts +85 -0
  99. package/types/comps/notify.d.ts +73 -0
  100. package/types/comps/numberBox.d.ts +155 -0
  101. package/types/comps/overlay.d.ts +46 -0
  102. package/types/comps/parse.d.ts +101 -0
  103. package/types/comps/picker.d.ts +115 -0
  104. package/types/comps/popup.d.ts +103 -0
  105. package/types/comps/radio.d.ts +77 -0
  106. package/types/comps/radioGroup.d.ts +97 -0
  107. package/types/comps/rate.d.ts +85 -0
  108. package/types/comps/readMore.d.ts +80 -0
  109. package/types/comps/row.d.ts +34 -0
  110. package/types/comps/scrollList.d.ts +51 -0
  111. package/types/comps/search.d.ts +167 -0
  112. package/types/comps/skeleton.d.ts +70 -0
  113. package/types/comps/slider.d.ts +79 -0
  114. package/types/comps/steps.d.ts +48 -0
  115. package/types/comps/stepsItem.d.ts +41 -0
  116. package/types/comps/sticky.d.ts +48 -0
  117. package/types/comps/subsection.d.ts +64 -0
  118. package/types/comps/swipeAction.d.ts +24 -0
  119. package/types/comps/swipeActionItem.d.ts +58 -0
  120. package/types/comps/swiper.d.ts +142 -0
  121. package/types/comps/swiperIndicator.d.ts +37 -0
  122. package/types/comps/switch.d.ts +73 -0
  123. package/types/comps/tabbar.d.ts +54 -0
  124. package/types/comps/tabbarItem.d.ts +52 -0
  125. package/types/comps/tabs.d.ts +85 -0
  126. package/types/comps/tag.d.ts +93 -0
  127. package/types/comps/text.d.ts +110 -0
  128. package/types/comps/textarea.d.ts +158 -0
  129. package/types/comps/toast.d.ts +59 -0
  130. package/types/comps/tooltip.d.ts +71 -0
  131. package/types/comps/transition.d.ts +61 -0
  132. package/types/comps/upload.d.ts +163 -0
  133. package/types/comps.d.ts +99 -0
  134. package/types/index.d.ts +47 -0
@@ -0,0 +1,225 @@
1
+ <template>
2
+ <view class="u-waterfall">
3
+ <view id="u-left-column" class="u-column">
4
+ <slot name="left" :leftList="leftList"></slot>
5
+ </view>
6
+ <view id="u-right-column" class="u-column">
7
+ <slot name="right" :rightList="rightList"></slot>
8
+ </view>
9
+ </view>
10
+ </template>
11
+
12
+ <script>
13
+ /**
14
+ * waterfall 瀑布流
15
+ * @description 这是一个瀑布流形式的组件,内容分为左右两列,结合uview的懒加载组件效果更佳。相较于某些只是奇偶数左右分别,或者没有利用vue作用域插槽的做法,uview的瀑布流实现了真正的 组件化,搭配LazyLoad 懒加载和loadMore 加载更多组件,让您开箱即用,眼前一亮。
16
+ * @tutorial https://uview-plus.jiangruyi.com/components/waterfall.html
17
+ * @property {Array} flow-list 用于渲染的数据
18
+ * @property {String Number} add-time 单条数据添加到队列的时间间隔,单位ms,见上方注意事项说明(默认200)
19
+ * @example <u-waterfall :flowList="flowList"></u-waterfall>
20
+ */
21
+ export default {
22
+ name: "u-waterfall",
23
+ props: {
24
+ // #ifdef VUE2
25
+ value: {
26
+ // 瀑布流数据
27
+ type: Array,
28
+ required: true,
29
+ default: function() {
30
+ return [];
31
+ }
32
+ },
33
+ // #endif
34
+ // #ifdef VUE3
35
+ modelValue: {
36
+ // 瀑布流数据
37
+ type: Array,
38
+ required: true,
39
+ default: function() {
40
+ return [];
41
+ }
42
+ },
43
+ // #endif
44
+ // 每次向结构插入数据的时间间隔,间隔越长,越能保证两列高度相近,但是对用户体验越不好
45
+ // 单位ms
46
+ addTime: {
47
+ type: [Number, String],
48
+ default: 200
49
+ },
50
+ // id值,用于清除某一条数据时,根据此idKey名称找到并移除,如数据为{idx: 22, name: 'lisa'}
51
+ // 那么该把idKey设置为idx
52
+ idKey: {
53
+ type: String,
54
+ default: 'id'
55
+ }
56
+ },
57
+ data() {
58
+ return {
59
+ leftList: [],
60
+ rightList: [],
61
+ tempList: [],
62
+ children: []
63
+ }
64
+ },
65
+ watch: {
66
+ copyFlowList(nVal, oVal) {
67
+ // 取差值,即这一次数组变化新增的部分
68
+ let startIndex = Array.isArray(oVal) && oVal.length > 0 ? oVal.length : 0;
69
+ // 拼接上原有数据
70
+ this.tempList = this.tempList.concat(this.cloneData(nVal.slice(startIndex)));
71
+ this.splitData();
72
+ }
73
+ },
74
+ mounted() {
75
+ this.tempList = this.cloneData(this.copyFlowList);
76
+ this.splitData();
77
+ },
78
+ computed: {
79
+ // 破坏flowList变量的引用,否则watch的结果新旧值是一样的
80
+ copyFlowList() {
81
+ // #ifdef VUE2
82
+ return this.cloneData(this.value);
83
+ // #endif
84
+ // #ifdef VUE3
85
+ return this.cloneData(this.modelValue);
86
+ // #endif
87
+ }
88
+ },
89
+ emits: ['update:modelValue'],
90
+ methods: {
91
+ async splitData() {
92
+ if (!this.tempList.length) return;
93
+ let leftRect = await this.$uGetRect('#u-left-column');
94
+ let rightRect = await this.$uGetRect('#u-right-column');
95
+ // 如果左边小于或等于右边,就添加到左边,否则添加到右边
96
+ let item = this.tempList[0];
97
+ // 解决多次快速上拉后,可能数据会乱的问题,因为经过上面的两个await节点查询阻塞一定时间,加上后面的定时器干扰
98
+ // 数组可能变成[],导致此item值可能为undefined
99
+ if (!item) return;
100
+ if (leftRect.height < rightRect.height) {
101
+ this.leftList.push(item);
102
+ } else if (leftRect.height > rightRect.height) {
103
+ this.rightList.push(item);
104
+ } else {
105
+ // 这里是为了保证第一和第二张添加时,左右都能有内容
106
+ // 因为添加第一张,实际队列的高度可能还是0,这时需要根据队列元素长度判断下一个该放哪边
107
+ if (this.leftList.length <= this.rightList.length) {
108
+ this.leftList.push(item);
109
+ } else {
110
+ this.rightList.push(item);
111
+ }
112
+ }
113
+ // 移除临时列表的第一项
114
+ this.tempList.splice(0, 1);
115
+ // 如果临时数组还有数据,继续循环
116
+ if (this.tempList.length) {
117
+ setTimeout(() => {
118
+ this.splitData();
119
+ }, this.addTime)
120
+ }
121
+ },
122
+ // 复制而不是引用对象和数组
123
+ cloneData(data) {
124
+ return JSON.parse(JSON.stringify(data));
125
+ },
126
+ // 清空数据列表
127
+ clear() {
128
+ this.leftList = [];
129
+ this.rightList = [];
130
+ // 同时清除父组件列表中的数据
131
+ // #ifdef VUE2
132
+ this.$emit('input', []);
133
+ // #endif
134
+ // #ifdef VUE3
135
+ this.$emit('update:modelValue', []);
136
+ // #endif
137
+ this.tempList = [];
138
+ },
139
+ // 清除某一条指定的数据,根据id实现
140
+ remove(id) {
141
+ // 如果findIndex找不到合适的条件,就会返回-1
142
+ let index = -1;
143
+ index = this.leftList.findIndex(val => val[this.idKey] == id);
144
+ if (index != -1) {
145
+ // 如果index不等于-1,说明已经找到了要找的id,根据index索引删除这一条数据
146
+ this.leftList.splice(index, 1);
147
+ } else {
148
+ // 同理于上方面的方法
149
+ index = this.rightList.findIndex(val => val[this.idKey] == id);
150
+ if (index != -1) this.rightList.splice(index, 1);
151
+ }
152
+ // 同时清除父组件的数据中的对应id的条目
153
+ // #ifdef VUE2
154
+ index = this.value.findIndex(val => val[this.idKey] == id);
155
+ if (index != -1) this.$emit('input', this.value.splice(index, 1));
156
+ // #endif
157
+ // #ifdef VUE3
158
+ index = this.modelvalue.findIndex(val => val[this.idKey] == id);
159
+ if (index != -1) this.$emit('input', this.modelvalue.splice(index, 1));
160
+ // #endif
161
+ },
162
+ // 修改某条数据的某个属性
163
+ modify(id, key, value) {
164
+ // 如果findIndex找不到合适的条件,就会返回-1
165
+ let index = -1;
166
+ index = this.leftList.findIndex(val => val[this.idKey] == id);
167
+ if (index != -1) {
168
+ // 如果index不等于-1,说明已经找到了要找的id,修改对应key的值
169
+ this.leftList[index][key] = value;
170
+ } else {
171
+ // 同理于上方面的方法
172
+ index = this.rightList.findIndex(val => val[this.idKey] == id);
173
+ if (index != -1) this.rightList[index][key] = value;
174
+ }
175
+ // 修改父组件的数据中的对应id的条目
176
+ // #ifdef VUE2
177
+ index = this.value.findIndex(val => val[this.idKey] == id);
178
+ // #endif
179
+ // #ifdef VUE3
180
+ index = this.modelvalue.findIndex(val => val[this.idKey] == id);
181
+ // #endif
182
+ if (index != -1) {
183
+ // 首先复制一份value的数据
184
+ // #ifdef VUE2
185
+ let data = this.cloneData(this.value);
186
+ // #endif
187
+ // #ifdef VUE3
188
+ let data = this.cloneData(this.modelvalue);
189
+ // #endif
190
+ // 修改对应索引的key属性的值为value
191
+ data[index][key] = value;
192
+ // 修改父组件通过v-model绑定的变量的值
193
+ // #ifdef VUE2
194
+ this.$emit('input', data);
195
+ // #endif
196
+ // #ifdef VUE3
197
+ this.$emit('update:modelValue', data);
198
+ // #endif
199
+
200
+ }
201
+ }
202
+ }
203
+ }
204
+ </script>
205
+
206
+ <style lang="scss" scoped>
207
+ @import "../../libs/css/components.scss";
208
+
209
+ .u-waterfall {
210
+ @include flex;
211
+ flex-direction: row;
212
+ align-items: flex-start;
213
+ }
214
+
215
+ .u-column {
216
+ @include flex;
217
+ flex: 1;
218
+ flex-direction: column;
219
+ height: auto;
220
+ }
221
+
222
+ .u-image {
223
+ width: 100%;
224
+ }
225
+ </style>
package/index.js CHANGED
@@ -34,8 +34,11 @@ import color from './libs/config/color.js'
34
34
  import platform from './libs/function/platform'
35
35
 
36
36
  // 导出
37
+ const http = new Request()
38
+ let themeType = ['primary', 'success', 'error', 'warning', 'info'];
39
+ export { route, http, debounce, throttle, platform, themeType, mixin, mpMixin, props, color, test, zIndex }
37
40
  export * from './libs/function/index.js'
38
- export const http = new Request()
41
+ export * from './libs/function/colorGradient.js'
39
42
 
40
43
  const $u = {
41
44
  route,
@@ -45,7 +48,7 @@ const $u = {
45
48
  rgbToHex: colorGradient.rgbToHex,
46
49
  colorToRgba: colorGradient.colorToRgba,
47
50
  test,
48
- type: ['primary', 'success', 'error', 'warning', 'info'],
51
+ type: themeType,
49
52
  http,
50
53
  config, // uview-plus配置信息相关,比如版本号
51
54
  zIndex,
@@ -14,6 +14,7 @@ export default {
14
14
  prop: '',
15
15
  rule: '',
16
16
  borderBottom: '',
17
+ labelPosition: '',
17
18
  labelWidth: '',
18
19
  rightIcon: '',
19
20
  leftIcon: '',
@@ -1,29 +1,30 @@
1
- /*
2
- * @Author : LQ
3
- * @Description :
4
- * @version : 1.0
5
- * @Date : 2021-08-20 16:44:21
6
- * @LastAuthor : LQ
7
- * @lastTime : 2021-08-20 17:23:37
8
- * @FilePath : /u-view2.0/uview-ui/libs/config/props/tag.js
9
- */
10
- export default {
11
- // tag 组件
12
- tag: {
13
- type: 'primary',
14
- disabled: false,
15
- size: 'medium',
16
- shape: 'square',
17
- text: '',
18
- bgColor: '',
19
- color: '',
20
- borderColor: '',
21
- closeColor: '#C6C7CB',
22
- name: '',
23
- plainFill: false,
24
- plain: false,
25
- closable: false,
26
- show: true,
27
- icon: ''
28
- }
29
- }
1
+ /*
2
+ * @Author : LQ
3
+ * @Description :
4
+ * @version : 1.0
5
+ * @Date : 2021-08-20 16:44:21
6
+ * @LastAuthor : LQ
7
+ * @lastTime : 2021-08-20 17:23:37
8
+ * @FilePath : /u-view2.0/uview-ui/libs/config/props/tag.js
9
+ */
10
+ export default {
11
+ // tag 组件
12
+ tag: {
13
+ type: 'primary',
14
+ disabled: false,
15
+ size: 'medium',
16
+ shape: 'square',
17
+ text: '',
18
+ bgColor: '',
19
+ color: '',
20
+ borderColor: '',
21
+ closeColor: '#C6C7CB',
22
+ name: '',
23
+ plainFill: false,
24
+ plain: false,
25
+ closable: false,
26
+ show: true,
27
+ icon: '',
28
+ iconColor: ''
29
+ }
30
+ }
@@ -1,5 +1,5 @@
1
1
  // 超出行数,自动显示行尾省略号,最多5行
2
- // 来自uView的温馨提示:当您在控制台看到此报错,说明需要在App.vue的style标签加上【lang="scss"】
2
+ // 来自uview-plus的温馨提示:当您在控制台看到此报错,说明需要在App.vue的style标签加上【lang="scss"】
3
3
  @for $i from 1 through 5 {
4
4
  .u-line-#{$i} {
5
5
  /* #ifdef APP-NVUE */
@@ -95,3 +95,6 @@
95
95
  opacity: 0.7;
96
96
  }
97
97
 
98
+ .cursor-pointer {
99
+ cursor: pointer;
100
+ }
@@ -1,11 +1,11 @@
1
1
  @import "./mixin.scss";
2
2
 
3
3
  /* #ifndef APP-NVUE */
4
- // 由于uView是基于nvue环境进行开发的,此环境中普通元素默认为flex-direction: column;
5
- // 所以在非nvue中,需要对元素进行重置为flex-direction: column; 否则可能会表现异常
6
- view,
7
- scroll-view,
8
- swiper-item,
4
+ // 由于uview-plus是基于nvue环境进行开发的,此环境中普通元素默认为flex-direction: column;
5
+ // 所以在非nvue中,需要对元素进行重置为flex-direction: column; 否则可能会表现异常
6
+ // 2024-04-09由于微信小程序会提示 Some selectors are not allowed in component wxss所以注释以下几行
7
+ // scroll-view,
8
+ // swiper-item,
9
9
  .u-empty,
10
10
  .u-empty__wrap,
11
11
  .u-tabs,
@@ -188,74 +188,74 @@
188
188
  // 以下属于项目(子元素)的类
189
189
 
190
190
  // 子元素交叉轴起点对齐
191
- // .u-flex-self-start {
192
- // align-self: flex-start;
193
- // }
191
+ .u-flex-self-start {
192
+ align-self: flex-start;
193
+ }
194
194
 
195
- // // 子元素交叉轴居中对齐
196
- // .u-flex-self-center {
197
- // align-self: center;
198
- // }
195
+ // 子元素交叉轴居中对齐
196
+ .u-flex-self-center {
197
+ align-self: center;
198
+ }
199
199
 
200
- // // 子元素交叉轴终点对齐
201
- // .u-flex-self-end {
202
- // align-self: flex-end;
203
- // }
200
+ // 子元素交叉轴终点对齐
201
+ .u-flex-self-end {
202
+ align-self: flex-end;
203
+ }
204
204
 
205
205
  // 子元素交叉轴第一行文字基线对齐
206
- // .u-flex-self-baseline {
207
- // align-self: baseline;
208
- // }
206
+ .u-flex-self-baseline {
207
+ align-self: baseline;
208
+ }
209
209
 
210
- // // 子元素交叉轴方向拉伸对齐
211
- // .u-flex-self-stretch {
212
- // align-self: stretch;
213
- // }
210
+ // 子元素交叉轴方向拉伸对齐
211
+ .u-flex-self-stretch {
212
+ align-self: stretch;
213
+ }
214
214
 
215
215
  // 多轴交叉时的对齐方式
216
216
 
217
217
  // 起点对齐
218
- // .u-flex-content-start {
219
- // align-content: flex-start;
220
- // }
218
+ .u-flex-content-start {
219
+ align-content: flex-start;
220
+ }
221
221
 
222
- // // 居中对齐
223
- // .u-flex-content-center {
224
- // align-content: center;
225
- // }
222
+ // 居中对齐
223
+ .u-flex-content-center {
224
+ align-content: center;
225
+ }
226
226
 
227
- // // 终点对齐
228
- // .u-flex-content-end {
229
- // align-content: flex-end;
230
- // }
227
+ // 终点对齐
228
+ .u-flex-content-end {
229
+ align-content: flex-end;
230
+ }
231
231
 
232
- // // 两端对齐
233
- // .u-flex-content-between {
234
- // align-content: space-between;
235
- // }
232
+ // 两端对齐
233
+ .u-flex-content-between {
234
+ align-content: space-between;
235
+ }
236
236
 
237
- // // 均分间距
238
- // .u-flex-content-around {
239
- // align-content: space-around;
240
- // }
237
+ // 均分间距
238
+ .u-flex-content-around {
239
+ align-content: space-around;
240
+ }
241
241
 
242
242
  // 全部居中对齐
243
243
  .u-flex-middle {
244
244
  justify-content: center;
245
245
  align-items: center;
246
- // align-self: center;
247
- // align-content: center;
246
+ align-self: center;
247
+ align-content: center;
248
248
  }
249
249
 
250
250
  // 是否可以放大
251
- // .u-flex-grow {
252
- // flex-grow: 1;
253
- // }
251
+ .u-flex-grow {
252
+ flex-grow: 1;
253
+ }
254
254
 
255
255
  // 是否可以缩小
256
- // .u-flex-shrink {
257
- // flex-shrink: 1;
258
- // }
256
+ .u-flex-shrink {
257
+ flex-shrink: 1;
258
+ }
259
259
 
260
260
  // 定义内外边距,历遍1-80
261
261
  @for $i from 0 through 80 {
@@ -145,8 +145,8 @@ export default {
145
145
  },
146
146
  onReachBottom() {
147
147
  uni.$emit('uOnReachBottom')
148
- },
149
- beforeDestroy() {
148
+ },
149
+ beforeUnmount() {
150
150
  // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
151
151
  // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
152
152
  if (this.parent && uni.$u.test.array(this.parent.children)) {
@@ -1,13 +1,15 @@
1
- export default {
2
- onLoad() {
3
- // 设置默认的转发参数
4
- uni.$u.mpShare = {
5
- title: '', // 默认为小程序名称
6
- path: '', // 默认为当前页面路径
7
- imageUrl: '' // 默认为当前页面的截图
8
- }
9
- },
10
- onShareAppMessage() {
11
- return uni.$u.mpShare
12
- }
13
- }
1
+
2
+ export default {
3
+ data() {
4
+ return {
5
+ mpShare: {
6
+ title: '', // 默认为小程序名称
7
+ path: '', // 默认为当前页面路径
8
+ imageUrl: '' // 默认为当前页面的截图
9
+ }
10
+ }
11
+ },
12
+ onShareAppMessage() {
13
+ return this.mpShare;
14
+ }
15
+ }
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.52",
5
+ "version": "3.2.5",
6
6
  "description": "uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",
@@ -0,0 +1,9 @@
1
+ export interface AllowedComponentProps {
2
+ class?: unknown;
3
+ style?: unknown;
4
+ }
5
+
6
+ export interface VNodeProps {
7
+ key?: string | number | symbol;
8
+ ref?: unknown;
9
+ }
@@ -0,0 +1,121 @@
1
+ import { AllowedComponentProps, VNodeProps } from './_common'
2
+
3
+ declare interface ActionSheetProps {
4
+ /**
5
+ * 是否展示
6
+ * @default false
7
+ */
8
+ show?: boolean
9
+ /**
10
+ * 设置标题
11
+ */
12
+ title?: string
13
+ /**
14
+ * 选项上方的描述信息
15
+ */
16
+ description?: string
17
+ /**
18
+ * 按钮的文字数组
19
+ * @default []
20
+ */
21
+ actions?: any[]
22
+ /**
23
+ * 取消按钮的文字,不为空时显示按钮
24
+ */
25
+ cancelText?: string
26
+ /**
27
+ * 点击某个菜单项时是否关闭弹窗
28
+ */
29
+ closeOnClickAction?: string
30
+ /**
31
+ * 是否开启底部安全区适配
32
+ * @default false
33
+ */
34
+ safeAreaInsetBottom?: boolean
35
+ /**
36
+ * 小程序的打开方式
37
+ */
38
+ openType?: string
39
+ /**
40
+ * 点击遮罩是否允许关闭
41
+ */
42
+ closeOnClickOverlay?: boolean
43
+ /**
44
+ * 圆角值,默认无圆角
45
+ * @default 0
46
+ */
47
+ round?: string | number
48
+ /**
49
+ * 指定返回用户信息的语言
50
+ * @default "en"
51
+ */
52
+ lang?: 'zh_CN' | 'zh_TW' | 'en'
53
+ /**
54
+ * 会话来源,open-type="contact"时有效。只微信小程序有效
55
+ */
56
+ sessionFrom?: string
57
+ /**
58
+ * 会话内消息卡片标题,openType="contact"时有效
59
+ */
60
+ sendMessageTitle?: string
61
+ /**
62
+ * 会话内消息卡片点击跳转小程序路径,openType="contact"时有效
63
+ */
64
+ sendMessagePath?: string
65
+ /**
66
+ * 会话内消息卡片图片,openType="contact"时有效
67
+ */
68
+ sendMessageImg?: string
69
+ /**
70
+ * 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效
71
+ * @default false
72
+ */
73
+ showMessageCard?: boolean
74
+ /**
75
+ * 打开 APP 时,向 APP 传递的参数,openType=launchApp 时有效
76
+ */
77
+ appParameter?: string
78
+ /**
79
+ * 点击ActionSheet列表项时触发
80
+ */
81
+ onSelect?: () => any
82
+ /**
83
+ * 点击取消按钮时触发
84
+ */
85
+ onClose?: () => any
86
+ /**
87
+ * 获取用户信息回调,openType="getUserInfo"时有效
88
+ * @param detail 用户信息
89
+ */
90
+ onGetuserinfo?: (detail: any) => any
91
+ /**
92
+ * 客服消息回调,openType="contact"时有效
93
+ */
94
+ onContact?: () => any
95
+ /**
96
+ * 获取用户手机号回调,openType="getPhoneNumber"时有效
97
+ */
98
+ onGetphonenumber?: () => any
99
+ /**
100
+ * 当使用开放能力时,发生错误的回调
101
+ */
102
+ onError?: (...args: any) => any
103
+ /**
104
+ * 在打开授权设置页并关闭后回调
105
+ */
106
+ onOpensetting?: (...args: any) => any
107
+ /**
108
+ * 打开 APP 成功的回调
109
+ */
110
+ onLaunchapp?: (...args: any) => any
111
+ }
112
+
113
+ declare interface _ActionSheet {
114
+ new (): {
115
+ $props: AllowedComponentProps &
116
+ VNodeProps &
117
+ ActionSheetProps
118
+ }
119
+ }
120
+
121
+ export declare const ActionSheet: _ActionSheet