uni-app does not use onShow to return to the previous page to refresh data

onShow: Refresh too frequently, poor performance

$on, $emit
list page (previous page):

	onLoad() {
			uni.$on('refreshData', () => {
				this.getList();
			})
		},

Details page (current page): Return to the previous page after modifying the list

                    this.$refs.uToast.show({
						message: "修改成功",
						type: "success",
						complete() {
							uni.$emit('refreshData');
							uni.navigateBack(1)
						}
					})

Guess you like

Origin blog.csdn.net/Stitch_xiao/article/details/128655435