CustomTradeList - support pagination

This commit is contained in:
Matthias 2021-12-25 19:50:00 +01:00
parent 7bc6192f73
commit 7bcc2e44ac

View File

@ -2,7 +2,7 @@
<div class="h-100 overflow-auto w-100 m-1">
<b-list-group>
<b-list-group-item
v-for="trade in trades"
v-for="trade in filteredTrades"
:key="trade.trade_id"
class="border border-secondary rounded my-05 px-2"
>
@ -105,7 +105,14 @@ export default class CustomTradeList extends Vue {
return this.trades.length;
}
perPage = this.activeTrades ? 200 : 15;
perPage = this.activeTrades ? 200 : 25;
get filteredTrades() {
return this.trades.slice(
(this.currentPage - 1) * this.perPage,
this.currentPage * this.perPage,
);
}
formatPriceWithDecimals(price) {
return formatPrice(price, this.stakeCurrencyDecimals);
@ -188,14 +195,4 @@ export default class CustomTradeList extends Vue {
margin-top: 0.125rem;
margin-bottom: 0.125rem;
}
.card-body {
padding: 0 0.2em;
}
.table-sm {
font-size: $fontsize-small;
}
.btn-xs {
padding: 0.1rem 0.25rem;
font-size: 0.75rem;
}
</style>