Skip to content

路由模块 - Router

路由模块实现了跨端的基础路由能力调用

使用方式

javascript
import Router from '@discuzq/sdk/dist/router';

Router.push({ url: '' })

API

小程序参数参见 https://taro-docs.jd.com/docs/apis/route/reLaunch/

web 参数参见 https://www.nextjs.cn/docs/api-reference/next/router

方法名参数类型描述平台
push{ url: string, as: any, options: Object } (小程序参见 Taro 的 navigateTo)页面跳转all
replace{ url: string, as: any, options: Object } (小程序参见 Taro 的 redirectTo)页面替换all
relaunch(小程序参见 Taro 的 reLaunch)重载mini
switchTab(小程序参见 Taro 的 switchTab)切换 tabmini
prefetch预加载web
beforePopStatecallback: () => any跳转前监听web
back-回退all
redirect{ url: string, as: any, options: Object } (小程序参见 Taro 的 redirectTo)页面重定向all

Released under the MIT License.