mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
don't expand list automatically when click show more button
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<f7-page ptr infinite :infinite-preloader="loadingMore" @ptr:refresh="reload" @infinite="loadMore">
|
<f7-page ptr infinite :infinite-preloader="loadingMore" @ptr:refresh="reload" @infinite="loadMore(true)">
|
||||||
<f7-navbar>
|
<f7-navbar>
|
||||||
<f7-nav-left :back-link="$t('Back')"></f7-nav-left>
|
<f7-nav-left :back-link="$t('Back')"></f7-nav-left>
|
||||||
<f7-nav-title :title="$t('Transaction Details')"></f7-nav-title>
|
<f7-nav-title :title="$t('Transaction Details')"></f7-nav-title>
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
</f7-accordion-toggle>
|
</f7-accordion-toggle>
|
||||||
</f7-card-header>
|
</f7-card-header>
|
||||||
<f7-card-content class="no-safe-areas" :padding="false" accordion-list>
|
<f7-card-content class="no-safe-areas" :padding="false" accordion-list>
|
||||||
<f7-accordion-content style="height: auto">
|
<f7-accordion-content :style="{ height: transactionMonthList.opened ? 'auto' : '' }">
|
||||||
<f7-list media-list>
|
<f7-list media-list>
|
||||||
<f7-list-item class="transaction-info"
|
<f7-list-item class="transaction-info"
|
||||||
v-for="(transaction, idx) in transactionMonthList.items"
|
v-for="(transaction, idx) in transactionMonthList.items"
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
</f7-card>
|
</f7-card>
|
||||||
|
|
||||||
<f7-block class="text-align-center" v-if="!loading && maxTime > 0">
|
<f7-block class="text-align-center" v-if="!loading && maxTime > 0">
|
||||||
<f7-link :class="{ 'disabled': loadingMore }" href="#" @click="loadMore">{{ $t('Load More') }}</f7-link>
|
<f7-link :class="{ 'disabled': loadingMore }" href="#" @click="loadMore(false)">{{ $t('Load More') }}</f7-link>
|
||||||
</f7-block>
|
</f7-block>
|
||||||
|
|
||||||
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
|
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
|
||||||
@@ -332,7 +332,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.transactions = [];
|
self.transactions = [];
|
||||||
self.setResult(transactionListData.result);
|
self.setResult(transactionListData.result, true);
|
||||||
|
|
||||||
self.loading = false;
|
self.loading = false;
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
@@ -355,7 +355,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadMore() {
|
loadMore(autoExpand) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (self.maxTime <= 0) {
|
if (self.maxTime <= 0) {
|
||||||
@@ -380,7 +380,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setResult(data.result);
|
self.setResult(data.result, autoExpand);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
self.loadingMore = false;
|
self.loadingMore = false;
|
||||||
|
|
||||||
@@ -460,7 +460,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
setResult(result) {
|
setResult(result, autoExpand) {
|
||||||
if (result.items && result.items.length) {
|
if (result.items && result.items.length) {
|
||||||
let currentMonthListIndex = -1;
|
let currentMonthListIndex = -1;
|
||||||
let currentMonthList = null;
|
let currentMonthList = null;
|
||||||
@@ -518,7 +518,7 @@ export default {
|
|||||||
year: transactionYear,
|
year: transactionYear,
|
||||||
month: transactionMonth,
|
month: transactionMonth,
|
||||||
yearMonth: `${transactionYear}-${transactionMonth}`,
|
yearMonth: `${transactionYear}-${transactionMonth}`,
|
||||||
opened: true,
|
opened: autoExpand,
|
||||||
items: []
|
items: []
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user