sadais-piui 1.2.0 → 1.2.1

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.
@@ -332,7 +332,7 @@ $unactive-color: #cccccc;
332
332
  .radio-label {
333
333
  color: $pi-primary-color;
334
334
  &.button {
335
- box-shadow: -2px 0 0 0 $pi-primary-color;
335
+ box-shadow: -4rpx 0 0 0 $pi-primary-color;
336
336
  }
337
337
  }
338
338
  &.line,
@@ -19,7 +19,12 @@
19
19
  >
20
20
  <view class="pi-select pi-h-100P pi-flex-column" :style="[customStyle]" :class="[customClass]">
21
21
  <slot name="header" />
22
- <scroll-view scroll-y class="pi-scroll">
22
+ <scroll-view
23
+ scroll-y
24
+ class="pi-scroll"
25
+ :scroll-into-view="getFirstSelectedId"
26
+ scroll-with-animation
27
+ >
23
28
  <view
24
29
  v-for="item in getItems"
25
30
  :id="`id-${item[keyField]}`"
@@ -265,6 +270,11 @@ export default {
265
270
  item.isSelected = isSelected
266
271
  return item
267
272
  })
273
+ },
274
+ getFirstSelectedId() {
275
+ const firstSelected = this.selected[0] || this.selected
276
+ const firstSelectedId = firstSelected[this.keyField]
277
+ return firstSelectedId ? `id-${firstSelected[this.keyField]}` : ''
268
278
  }
269
279
  },
270
280
  watch: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {