# 返回

返回方法,支持:

  1. 无历史栈情况
  2. 首页为 tabBar
  3. 页面自定义返回

页面自定义返回优先级:

  • options.previousPath
  • 页面中声明的 getNavigatorPreviousPath 方法,如有
  • options.home

# 方法

import { goBack } from '@tencent/press-next/common/utils/go-back';


goBack({
  home: '/views/index/index',
});

# 类型

export interface IOptions {
  home?: string;
  previousPath?: string | (() => string);
  isHomeTabBar?: boolean;
}

更多类型参考这里 (opens new window)

横屏
最后更新时间: 2025/4/5 17:29:07