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.
- package/changelog.md +51 -0
- package/components/u-action-sheet/u-action-sheet.vue +1 -1
- package/components/u-album/u-album.vue +261 -261
- package/components/u-avatar/u-avatar.vue +3 -2
- package/components/u-avatar-group/u-avatar-group.vue +106 -106
- package/components/u-button/u-button.vue +6 -1
- package/components/u-calendar/u-calendar.vue +4 -3
- package/components/u-cell/u-cell.vue +4 -2
- package/components/u-checkbox/props.js +5 -0
- package/components/u-checkbox/u-checkbox.vue +29 -17
- package/components/u-code/u-code.vue +1 -1
- package/components/u-dropdown/props.js +8 -14
- package/components/u-dropdown/u-dropdown.vue +202 -77
- package/components/u-dropdown-item/props.js +45 -36
- package/components/u-dropdown-item/u-dropdown-item.vue +121 -148
- package/components/u-form/u-form.vue +1 -1
- package/components/u-form-item/props.js +6 -1
- package/components/u-form-item/u-form-item.vue +1 -1
- package/components/u-grid/u-grid.vue +4 -2
- package/components/u-grid-item/u-grid-item.vue +8 -7
- package/components/u-input/u-input.vue +1 -1
- package/components/u-lazy-load/u-lazy-load.vue +251 -0
- package/components/u-number-box/u-number-box.vue +4 -4
- package/components/u-picker/u-picker.vue +5 -2
- package/components/u-popup/u-popup.vue +1 -1
- package/components/u-radio/u-radio.vue +2 -2
- package/components/u-rate/u-rate.vue +1 -1
- package/components/u-read-more/u-read-more.vue +164 -160
- package/components/u-slider/u-slider.vue +6 -6
- package/components/u-steps-item/u-steps-item.vue +318 -318
- package/components/u-subsection/u-subsection.vue +35 -21
- package/components/u-swiper/u-swiper.vue +6 -8
- package/components/u-switch/u-switch.vue +1 -1
- package/components/u-tabbar-item/u-tabbar-item.vue +1 -1
- package/components/u-tabs/u-tabs.vue +1 -0
- package/components/u-tag/props.js +5 -2
- package/components/u-tag/u-tag.vue +1 -1
- package/components/u-text/u-text.vue +226 -226
- package/components/u-textarea/u-textarea.vue +275 -275
- package/components/u-transition/u-transition.vue +1 -1
- package/components/u-waterfall/u-waterfall.vue +225 -0
- package/index.js +5 -2
- package/libs/config/props/formItem.js +1 -0
- package/libs/config/props/tag.js +30 -29
- package/libs/css/common.scss +4 -1
- package/libs/css/components.scss +5 -5
- package/libs/css/flex.scss +45 -45
- package/libs/mixin/mixin.js +2 -2
- package/libs/mixin/mpShare.js +15 -13
- package/package.json +1 -1
- package/types/comps/_common.d.ts +9 -0
- package/types/comps/actionSheet.d.ts +121 -0
- package/types/comps/album.d.ts +72 -0
- package/types/comps/alert.d.ts +55 -0
- package/types/comps/avatar.d.ts +85 -0
- package/types/comps/avatarGroup.d.ts +62 -0
- package/types/comps/backTop.d.ts +74 -0
- package/types/comps/badge.d.ts +76 -0
- package/types/comps/button.d.ts +169 -0
- package/types/comps/calendar.d.ts +164 -0
- package/types/comps/cell.d.ts +133 -0
- package/types/comps/cellGroup.d.ts +27 -0
- package/types/comps/checkbox.d.ts +69 -0
- package/types/comps/checkboxGroup.d.ts +93 -0
- package/types/comps/code.d.ts +69 -0
- package/types/comps/codeInput.d.ts +98 -0
- package/types/comps/col.d.ts +43 -0
- package/types/comps/collapse.d.ts +52 -0
- package/types/comps/collapseItem.d.ts +83 -0
- package/types/comps/countDown.d.ts +60 -0
- package/types/comps/countTo.d.ts +88 -0
- package/types/comps/datetimePicker.d.ts +146 -0
- package/types/comps/divider.d.ts +58 -0
- package/types/comps/empty.d.ts +72 -0
- package/types/comps/form.d.ts +76 -0
- package/types/comps/formItem.d.ts +68 -0
- package/types/comps/gap.d.ts +35 -0
- package/types/comps/grid.d.ts +34 -0
- package/types/comps/gridItem.d.ts +28 -0
- package/types/comps/icon.d.ts +93 -0
- package/types/comps/image.d.ts +119 -0
- package/types/comps/indexAnchor.d.ts +38 -0
- package/types/comps/indexItem.d.ts +18 -0
- package/types/comps/indexList.d.ts +39 -0
- package/types/comps/input.d.ts +234 -0
- package/types/comps/keyboard.d.ts +125 -0
- package/types/comps/line.d.ts +44 -0
- package/types/comps/lineProgress.d.ts +51 -0
- package/types/comps/link.d.ts +51 -0
- package/types/comps/list.d.ts +92 -0
- package/types/comps/listItem.d.ts +18 -0
- package/types/comps/loadMore.d.ts +108 -0
- package/types/comps/loadingIcon.d.ts +68 -0
- package/types/comps/loadingPage.d.ts +58 -0
- package/types/comps/modal.d.ts +115 -0
- package/types/comps/navbar.d.ts +113 -0
- package/types/comps/noNetwork.d.ts +40 -0
- package/types/comps/noticeBar.d.ts +85 -0
- package/types/comps/notify.d.ts +73 -0
- package/types/comps/numberBox.d.ts +155 -0
- package/types/comps/overlay.d.ts +46 -0
- package/types/comps/parse.d.ts +101 -0
- package/types/comps/picker.d.ts +115 -0
- package/types/comps/popup.d.ts +103 -0
- package/types/comps/radio.d.ts +77 -0
- package/types/comps/radioGroup.d.ts +97 -0
- package/types/comps/rate.d.ts +85 -0
- package/types/comps/readMore.d.ts +80 -0
- package/types/comps/row.d.ts +34 -0
- package/types/comps/scrollList.d.ts +51 -0
- package/types/comps/search.d.ts +167 -0
- package/types/comps/skeleton.d.ts +70 -0
- package/types/comps/slider.d.ts +79 -0
- package/types/comps/steps.d.ts +48 -0
- package/types/comps/stepsItem.d.ts +41 -0
- package/types/comps/sticky.d.ts +48 -0
- package/types/comps/subsection.d.ts +64 -0
- package/types/comps/swipeAction.d.ts +24 -0
- package/types/comps/swipeActionItem.d.ts +58 -0
- package/types/comps/swiper.d.ts +142 -0
- package/types/comps/swiperIndicator.d.ts +37 -0
- package/types/comps/switch.d.ts +73 -0
- package/types/comps/tabbar.d.ts +54 -0
- package/types/comps/tabbarItem.d.ts +52 -0
- package/types/comps/tabs.d.ts +85 -0
- package/types/comps/tag.d.ts +93 -0
- package/types/comps/text.d.ts +110 -0
- package/types/comps/textarea.d.ts +158 -0
- package/types/comps/toast.d.ts +59 -0
- package/types/comps/tooltip.d.ts +71 -0
- package/types/comps/transition.d.ts +61 -0
- package/types/comps/upload.d.ts +163 -0
- package/types/comps.d.ts +99 -0
- package/types/index.d.ts +47 -0
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
:style="[barStyle]"
|
|
12
12
|
:class="[
|
|
13
13
|
mode === 'button' && 'u-subsection--button__bar',
|
|
14
|
-
|
|
14
|
+
innerCurrent === 0 &&
|
|
15
15
|
mode === 'subsection' &&
|
|
16
16
|
'u-subsection__bar--first',
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
innerCurrent > 0 &&
|
|
18
|
+
innerCurrent < list.length - 1 &&
|
|
19
19
|
mode === 'subsection' &&
|
|
20
20
|
'u-subsection__bar--center',
|
|
21
|
-
|
|
21
|
+
innerCurrent === list.length - 1 &&
|
|
22
22
|
mode === 'subsection' &&
|
|
23
23
|
'u-subsection__bar--last',
|
|
24
24
|
]"
|
|
@@ -83,6 +83,8 @@ export default {
|
|
|
83
83
|
width: 0,
|
|
84
84
|
height: 0,
|
|
85
85
|
},
|
|
86
|
+
innerCurrent: '',
|
|
87
|
+
windowResizeCallback: {}
|
|
86
88
|
};
|
|
87
89
|
},
|
|
88
90
|
watch: {
|
|
@@ -92,6 +94,9 @@ export default {
|
|
|
92
94
|
current: {
|
|
93
95
|
immediate: true,
|
|
94
96
|
handler(n) {
|
|
97
|
+
if (n !== this.innerCurrent) {
|
|
98
|
+
this.innerCurrent = n
|
|
99
|
+
}
|
|
95
100
|
// #ifdef APP-NVUE
|
|
96
101
|
// 在安卓nvue上,如果通过translateX进行位移,到最后一个时,会导致右侧无法绘制圆角
|
|
97
102
|
// 故用animation模块进行位移
|
|
@@ -129,7 +134,7 @@ export default {
|
|
|
129
134
|
// 通过translateX移动滑块,其移动的距离为索引*item的宽度
|
|
130
135
|
// #ifndef APP-NVUE
|
|
131
136
|
style.transform = `translateX(${
|
|
132
|
-
this.
|
|
137
|
+
this.innerCurrent * this.itemRect.width
|
|
133
138
|
}px)`;
|
|
134
139
|
// #endif
|
|
135
140
|
if (this.mode === "subsection") {
|
|
@@ -156,16 +161,16 @@ export default {
|
|
|
156
161
|
return (index) => {
|
|
157
162
|
const style = {};
|
|
158
163
|
style.fontWeight =
|
|
159
|
-
this.bold && this.
|
|
164
|
+
this.bold && this.innerCurrent === index ? "bold" : "normal";
|
|
160
165
|
style.fontSize = uni.$u.addUnit(this.fontSize);
|
|
161
166
|
// subsection模式下,激活时默认为白色的文字
|
|
162
167
|
if (this.mode === "subsection") {
|
|
163
168
|
style.color =
|
|
164
|
-
this.
|
|
169
|
+
this.innerCurrent === index ? "#fff" : this.inactiveColor;
|
|
165
170
|
} else {
|
|
166
171
|
// button模式下,激活时文字颜色默认为activeColor
|
|
167
172
|
style.color =
|
|
168
|
-
this.
|
|
173
|
+
this.innerCurrent === index
|
|
169
174
|
? this.activeColor
|
|
170
175
|
: this.inactiveColor;
|
|
171
176
|
}
|
|
@@ -175,10 +180,18 @@ export default {
|
|
|
175
180
|
},
|
|
176
181
|
mounted() {
|
|
177
182
|
this.init();
|
|
183
|
+
this.windowResizeCallback = (res) => {
|
|
184
|
+
this.init();
|
|
185
|
+
}
|
|
186
|
+
uni.onWindowResize(this.windowResizeCallback)
|
|
187
|
+
},
|
|
188
|
+
beforeUnmount() {
|
|
189
|
+
uni.offWindowResize(this.windowResizeCallback)
|
|
178
190
|
},
|
|
179
191
|
emits: ["change"],
|
|
180
192
|
methods: {
|
|
181
193
|
init() {
|
|
194
|
+
this.innerCurrent = this.current
|
|
182
195
|
uni.$u.sleep().then(() => this.getRect());
|
|
183
196
|
},
|
|
184
197
|
// 判断展示文本
|
|
@@ -202,6 +215,7 @@ export default {
|
|
|
202
215
|
// #endif
|
|
203
216
|
},
|
|
204
217
|
clickHandler(index) {
|
|
218
|
+
this.innerCurrent = index
|
|
205
219
|
this.$emit("change", index);
|
|
206
220
|
},
|
|
207
221
|
},
|
|
@@ -221,20 +235,20 @@ export default {
|
|
|
221
235
|
/* #endif */
|
|
222
236
|
|
|
223
237
|
&--button {
|
|
224
|
-
height:
|
|
238
|
+
height: 34px;
|
|
225
239
|
background-color: rgb(238, 238, 239);
|
|
226
240
|
padding: 3px;
|
|
227
|
-
border-radius:
|
|
241
|
+
border-radius: 4px;
|
|
228
242
|
align-items: stretch;
|
|
229
243
|
|
|
230
244
|
&__bar {
|
|
231
245
|
background-color: #ffffff;
|
|
232
|
-
border-radius:
|
|
246
|
+
border-radius: 4px !important;
|
|
233
247
|
}
|
|
234
248
|
}
|
|
235
249
|
|
|
236
250
|
&--subsection {
|
|
237
|
-
height:
|
|
251
|
+
height: 32px;
|
|
238
252
|
}
|
|
239
253
|
|
|
240
254
|
&__bar {
|
|
@@ -246,8 +260,8 @@ export default {
|
|
|
246
260
|
/* #endif */
|
|
247
261
|
|
|
248
262
|
&--first {
|
|
249
|
-
border-top-left-radius:
|
|
250
|
-
border-bottom-left-radius:
|
|
263
|
+
border-top-left-radius: 4px;
|
|
264
|
+
border-bottom-left-radius: 4px;
|
|
251
265
|
border-top-right-radius: 0px;
|
|
252
266
|
border-bottom-right-radius: 0px;
|
|
253
267
|
}
|
|
@@ -262,8 +276,8 @@ export default {
|
|
|
262
276
|
&--last {
|
|
263
277
|
border-top-left-radius: 0px;
|
|
264
278
|
border-bottom-left-radius: 0px;
|
|
265
|
-
border-top-right-radius:
|
|
266
|
-
border-bottom-right-radius:
|
|
279
|
+
border-top-right-radius: 4px;
|
|
280
|
+
border-bottom-right-radius: 4px;
|
|
267
281
|
}
|
|
268
282
|
}
|
|
269
283
|
|
|
@@ -280,18 +294,18 @@ export default {
|
|
|
280
294
|
}
|
|
281
295
|
|
|
282
296
|
&--first {
|
|
283
|
-
border-top-left-radius:
|
|
284
|
-
border-bottom-left-radius:
|
|
297
|
+
border-top-left-radius: 4px;
|
|
298
|
+
border-bottom-left-radius: 4px;
|
|
285
299
|
}
|
|
286
300
|
|
|
287
301
|
&--last {
|
|
288
|
-
border-top-right-radius:
|
|
289
|
-
border-bottom-right-radius:
|
|
302
|
+
border-top-right-radius: 4px;
|
|
303
|
+
border-bottom-right-radius: 4px;
|
|
290
304
|
}
|
|
291
305
|
|
|
292
306
|
&__text {
|
|
293
307
|
font-size: 12px;
|
|
294
|
-
line-height:
|
|
308
|
+
line-height: 14px;
|
|
295
309
|
@include flex;
|
|
296
310
|
align-items: center;
|
|
297
311
|
transition-property: color;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<view
|
|
3
3
|
class="u-swiper"
|
|
4
4
|
:style="{
|
|
5
|
-
backgroundColor: bgColor,
|
|
5
|
+
backgroundColor: bgColor,
|
|
6
6
|
height: $u.addUnit(height),
|
|
7
7
|
borderRadius: $u.addUnit(radius)
|
|
8
8
|
}"
|
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
>
|
|
14
14
|
<u-loading-icon mode="circle"></u-loading-icon>
|
|
15
15
|
</view>
|
|
16
|
-
<swiper
|
|
17
|
-
v-else
|
|
16
|
+
<swiper
|
|
18
17
|
class="u-swiper__wrapper"
|
|
19
|
-
:style="{
|
|
20
|
-
height: $u.addUnit(height)
|
|
18
|
+
:style="{
|
|
19
|
+
height: $u.addUnit(height)
|
|
21
20
|
}"
|
|
22
21
|
@change="change"
|
|
23
22
|
:circular="circular"
|
|
@@ -206,7 +205,7 @@
|
|
|
206
205
|
|
|
207
206
|
<style lang="scss" scoped>
|
|
208
207
|
@import "../../libs/css/components.scss";
|
|
209
|
-
|
|
208
|
+
|
|
210
209
|
.u-swiper {
|
|
211
210
|
@include flex;
|
|
212
211
|
justify-content: center;
|
|
@@ -214,8 +213,7 @@
|
|
|
214
213
|
position: relative;
|
|
215
214
|
overflow: hidden;
|
|
216
215
|
|
|
217
|
-
&__wrapper {
|
|
218
|
-
flex: 1;
|
|
216
|
+
&__wrapper {
|
|
219
217
|
|
|
220
218
|
&__item {
|
|
221
219
|
flex: 1;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:show="show"
|
|
5
5
|
style="display: inline-flex;"
|
|
6
6
|
>
|
|
7
|
-
<view class="u-tag-wrapper">
|
|
7
|
+
<view class="u-tag-wrapper cursor-pointer">
|
|
8
8
|
<view
|
|
9
9
|
class="u-tag"
|
|
10
10
|
:class="[`u-tag--${shape}`, !plain && `u-tag--${type}`, plain && `u-tag--${type}--plain`, `u-tag--${size}`, plain && plainFill && `u-tag--${type}--plain--fill`]"
|