2022-03-19 Work record--Wechat applet-Toast and callback functions for this.setData

Toastand this.setDatathe callback function

1. Toast callback function

insert image description here

Toast({
    
    
   type: 'success',
   message: res.msg,
   onClose: () => {
    
     // 回调函数 onClose
      this.setData({
    
    
         textareaValue: '',
      })
   },
});

2. The callback function of this.setData

insert image description here

this.setData(
{
    
    
  attendance_detail: res.data,
},
()=>{
    
     // 回调函数
  this.reGetData(res.data.data);
}
)

Guess you like

Origin blog.csdn.net/weixin_48850734/article/details/123678578