fix(历史记录): 展开历史记录面板时未自动加载数据
展开 showHistory 后没有触发 loadHistoryFragments/loadHistoryReports, 需要用户输入搜索或切换 tab 才能看到数据。增加 watch(showHistory) 在展开时 立即加载当前 tab 的分页数据。
This commit is contained in:
@@ -58,6 +58,14 @@ const reportsTotal = ref(0);
|
||||
const reportsPage = ref(1);
|
||||
const PAGE_SIZE = 10;
|
||||
|
||||
watch(showHistory, (val) => {
|
||||
if (val) {
|
||||
// 展开时立即加载当前 tab 的数据
|
||||
if (historyTab.value === "fragments") loadHistoryFragments();
|
||||
else loadHistoryReports();
|
||||
}
|
||||
});
|
||||
|
||||
const loadHistoryFragments = async () => {
|
||||
loadingHistory.value = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user