[WIP] fix(front): make pagination work
This commit is contained in:
parent
28bc337846
commit
f83c6be540
|
@ -247,10 +247,9 @@ const updatePage = (page: number) => {
|
|||
/>
|
||||
</div>
|
||||
<Pagination
|
||||
v-if="paginateResults && totalTracks > paginateBy"
|
||||
:paginate-by="paginateBy"
|
||||
:total="totalTracks"
|
||||
:current="tracks !== undefined ? page : currentPage"
|
||||
v-if="paginateResults"
|
||||
:pages="paginateBy"
|
||||
v-model:page="page"
|
||||
@update:current="updatePage"
|
||||
/>
|
||||
</div>
|
||||
|
@ -275,19 +274,12 @@ const updatePage = (page: number) => {
|
|||
:is-album="isAlbum"
|
||||
:is-podcast="isPodcast"
|
||||
/>
|
||||
<div
|
||||
v-if="tracks && paginateResults && totalTracks > paginateBy"
|
||||
class="ui center aligned basic segment tablet-and-below"
|
||||
>
|
||||
<Pagination
|
||||
v-if="paginateResults && totalTracks > paginateBy"
|
||||
:paginate-by="paginateBy"
|
||||
:total="totalTracks"
|
||||
:current="tracks !== undefined ? page : currentPage"
|
||||
:compact="true"
|
||||
@update:current="updatePage"
|
||||
/>
|
||||
</div>
|
||||
<Pagination
|
||||
v-if="paginateResults"
|
||||
:pages="paginateBy"
|
||||
v-model:page="page"
|
||||
@update:current="updatePage"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -226,8 +226,8 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
|||
<Spacer grow />
|
||||
<Pagination
|
||||
v-if="result && result.count > paginateBy"
|
||||
:page="page"
|
||||
:pages="Math.ceil((result?.results.length || 0)/paginateBy)"
|
||||
v-model:page="page"
|
||||
:pages="Math.ceil((result.count || 0)/paginateBy)"
|
||||
/>
|
||||
</Layout>
|
||||
</template>
|
||||
|
|
|
@ -237,7 +237,7 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
|||
<Pagination
|
||||
v-if="result && result.count > paginateBy"
|
||||
:page="page"
|
||||
:pages="Math.ceil((result?.results.length || 0)/paginateBy)"
|
||||
:pages="Math.ceil((result.count || 0)/paginateBy)"
|
||||
/>
|
||||
</Layout>
|
||||
</template>
|
||||
|
|
|
@ -211,8 +211,8 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
|
|||
<Spacer grow />
|
||||
<Pagination
|
||||
v-if="result && result.count > paginateBy"
|
||||
:page="page"
|
||||
:pages="Math.ceil((result?.results.length || 0)/paginateBy)"
|
||||
v-model:page="page"
|
||||
:pages="Math.ceil((result.count || 0)/paginateBy)"
|
||||
/>
|
||||
</Layout>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue