可通过路由跳转NavPathStack.pushPathByName传递参数在弹窗组件的.onReady事件中获取路由跳转参数@Component export struct DefaultDialog { private dialogOptions?: AppDialogOption; build() { NavDestination() { ... } .onReady((ctx: NavDestinationContext) => { console.log("onReady") this.dialogOptions = ctx.pathInfo.param as AppDialogOption; }) } }使用NavPathStack中的onPop回调来接收上一个弹窗返回的参数onPop = (data: PopInfo) => { console.log("onPop") // 更新状态变量 this.params[index] = JSON.stringify(data.result) } navPathStack.pushPathByName(CommonConstants.DEFAULT_DIALOG, this.options, this.options!.onPop!, true)上一个弹窗在关闭时传入参数navPathStack.popToIndex(this.stackIndex, params);
可通过路由跳转NavPathStack.pushPathByName传递参数
在弹窗组件的.onReady事件中获取路由跳转参数
使用NavPathStack中的onPop回调来接收上一个弹窗返回的参数
上一个弹窗在关闭时传入参数