uni.navigateBack(options?)
关闭当前页面,返回上一页面或多级页面
参数
NavigateBackOptions
名称 | 类型 | 必填 | 描述 |
delta | number | 否 | 返回的页面数,如果 delta 大于现有页面数,则返回到首页 |
animationType | string | 否 | 窗口关闭的动画类型 - auto: 自动选择动画效果 - none: 无动画效果 - slide-out-right: 横向向右侧滑出屏幕动画 - slide-out-left: 横向向左侧滑出屏幕动画 - slide-out-top: 竖向向上侧滑出屏幕动画 - slide-out-bottom: 竖向向下侧滑出屏幕动画 - fade-out: 从不透明到透明逐渐隐藏动画 - zoom-in: 从大逐渐缩小关闭动画 - zoom-fade-in: 从大逐渐缩小并且从不透明到透明逐渐隐藏关闭动画 - pop-out: 从右侧平移出栈动画效果 - UnionType => 'auto' | 'none' | 'slide-out-right' | 'slide-out-left' | 'slide-out-top' | 'slide-out-bottom' | 'fade-out' | 'zoom-in' | 'zoom-fade-in' | 'pop-out' |
animationDuration | number | 否 | 窗口关闭动画的持续时间,单位为 ms |
success | (AsyncApiSuccessResult) => void | 否 | 接口调用成功的回调函数 |
fail | (UniError) => void | 否 | 接口调用失败的回调函数 |
complete | (AsyncApiResult) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
参见
navigateBack
通用类型
GeneralCallbackResult
名称 | 类型 | 必填 | 描述 |
errMsg | string | 是 | 错误信息 |