Skip to content

Commit

Permalink
feat: make sure animation effect when one page
Browse files Browse the repository at this point in the history
  • Loading branch information
skie1997 committed Jan 3, 2025
1 parent f6b608b commit 13eb998
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,29 @@ export class RankingListChartSpecTransformer extends CommonChartSpecTransformer
]
});
});

// 只有1页时, player循环播放时, prePage和curPage data一致, 导致没有动画效果
// 在此手动复制1页, 且prePage和curPage dataKey不一致, 保证动画效果
if (result.length === 1) {
result.push({
data: [
{
id: 'datas',
values: pagerData['page1'].map((d, i) => {
return { ...d, [DATA_KEY]: 'page2' + '_' + i + '_' + new Date().getTime() };
})
},
{
id: 'order',
values: [
{
order: 'page2'
}
]
}
]
});
}
return result;
};

Expand Down

0 comments on commit 13eb998

Please sign in to comment.