在小程序添加點擊按鈕實現重新渲染頁面
index.wxml文件
<button bindtap="onrefresh">重新渲染</button> //添加一個點擊重新渲染按鈕
index.js文件
, onrefresh:function(){ wx.showToast({ title: '開始重新渲染', icon: 'success', duration: 2000 }); this.onLoad();}//在onrefresh中完成重新渲染
, onrefresh:function(){
wx.showToast({
title: '開始重新渲染',
icon: 'success',
duration: 2000
});
this.onLoad();
}//在onrefresh中完成重新渲染