发布于 2021-06-06 02:29:06
这可以用<ais-configure :hitsPerPage="50" />来完成。例如:
<div class="search-panel__results">
<ais-search-box placeholder="Search here…" autofocus/>
<ais-hits :transform-items="transformItems">
<template slot="item" slot-scope="{ item }">
<ais-configure :hitsPerPage="50" />
<div>
<div class="hit-info"> {{ item.year }}</div>
<div class="hit-info">
<ais-highlight :hit="item" attribute="firstname" />
<ais-highlight :hit="item" attribute="surname" />
</div>
<div class="hit-info motivation">
<ais-highlight :hit="item" attribute="motivation" />
</div>
</div>
</template>
</ais-hits>
<ais-pagination />
</div>要将默认分页限制更改为200次点击,请在App.vue文件中(从引用的官方演示中)将数据部分更新为以下内容(将paginationTotalHits设置为所需的数字):
data() {
return {
searchClient: instantMeiliSearch(
MEILISEARCH_HOST,
MEILISEARCH_API_KEY,
{
paginationTotalHits: 300, // default: 200.
}
),
};
},https://stackoverflow.com/questions/67848998
复制相似问题