How to refresh the page of WeChat applet based on uniapp (absolutely effective)

Because my graduation project is a WeChat applet written in uniapp.
Encountered such a problem, checked a lot of information, and finally found such a method.
Write it out now to save everyone time and energy.
It is to use uni.redirectTo to realize page jump to realize page refresh

//   这是一个点击事件
btn(){
    
    
uni.redirectTo({
    
    
	url: '../Land/Land'  //这是你的当前页面地址
 });
}
//这样页面就会刷新了

Note: This cannot refresh the tabBar page. Don't use it on the tabBar stupidly. You
can only use switchTab to jump to the tabBar page
. Hope it can help you! If you don't understand, you can leave a message, and if you can solve it, I will help you solve it.

Guess you like

Origin blog.csdn.net/z2000ky/article/details/130600207