小程序本身不存在刷新,删除元素后重新获取下当前的数据,并去执行下onLoad函数
//删除
delete:function(e){
var that=this
var id = e.currentTarget.dataset.id //当前点击的id
wx.showModal({
title: '提示',
content: '确定删除吗',
success:function(res){
if(res.confirm){
myConsult.getDelete(id, (res) => {
console.log(res)
if(res.code==201){
that.setData({ pageIndex: 1, doctorArr: [] });// 重点
that.onLoad()//重点 重新执行下onLoad去获取当前的数据
}
});
}
}
});
}
小程序刷新页面
最新推荐文章于 2024-07-21 23:07:29 发布