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.
|
@@ -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
|
|
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: {
|