uniapp returns to the previous page and refreshes

When using uniapp development, some form submission pages, using uni.redirectTo(); will cause the returned page to enter the list before entering the form page, so the data is also the data before the form is saved; the operation feedback is very unfriendly. Consider submitting the
form , return to the previous page instead, and then refresh the list data of the previous page


	/**
	 * uni.navigateBack and reload
	 * 返回上一页并刷新列表
	 */
	back_reload(){
    
    
		let pages = getCurrentPages();
		uni.navigateBack({
    
    
			delta: 1,
			success() {
    
    
				//pages.length-1 即最后一个为当前页,所以取当前页面的上一级
				pages[pages.length-2].$vm.reloadList();
			}
		})
	},

//上级页面中添加 reloadList 方法实现刷新

Guess you like

Origin blog.csdn.net/qq_42049516/article/details/129494660