Skip to content

Commit f633a3f

Browse files
author
Guillaume Chau
committed
fix(ui): plugin search pagination
1 parent 14881ee commit f633a3f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/@vue/cli-ui/src/views/ProjectPluginsAdd.vue

+8-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
api-key="db283631f89b5b8a10707311f911fd00"
2020
index-name="npm-search"
2121
:query-parameters="{
22-
hitsPerPage: 10,
22+
hitsPerPage: 20,
2323
attributesToRetrieve: [
2424
'name',
2525
'description',
@@ -40,7 +40,7 @@
4040
ref="searchInput"
4141
:placeholder="$t('views.project-plugins-add.tabs.search.search-input')"
4242
/>
43-
<ais-results>
43+
<ais-results ref="results">
4444
<PackageSearchItem
4545
slot-scope="{ result }"
4646
:pkg="result"
@@ -54,7 +54,7 @@
5454
<div>{{ $t('views.project-plugins-add.tabs.search.not-found') }}</div>
5555
</div>
5656
</ais-no-results>
57-
<InstantSearchPagination/>
57+
<InstantSearchPagination @page-change="scrollResultsToTop()"/>
5858
</ais-index>
5959
</div>
6060

@@ -309,6 +309,11 @@ export default {
309309
} catch (e) {
310310
console.error(e)
311311
}
312+
},
313+
314+
scrollResultsToTop () {
315+
const vm = this.$refs.results
316+
if (vm) vm.$el.scrollTop = 0
312317
}
313318
}
314319
}

0 commit comments

Comments
 (0)