ant-design-mobile realizes ListView pull refresh display last update time

1. It is a common requirement to refresh on the APP to achieve the last update time. Here is the PullToRefreshcode to achieve this effect.
2. The realization idea is: remember the current time every time you refresh.

3. The code configuration is a configuration item of PullToRefresh:
Insert picture description here
4.

     pullToRefresh={
    
    
            <PullToRefresh
              refreshing={
    
    refreshing}
              onRefresh={
    
    this.onRefresh}
              indicator={
    
    {
    
     activate: `上次更新${
      
      lastUpdateTime}` }}
            />
          }

The specific code will not be posted, it is very simple.

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45416217/article/details/114438101