@tarojs/router

  • Version 3.5.8
  • Published
  • 308 kB
  • 7 dependencies
  • MIT license

Install

npm i @tarojs/router
yarn add @tarojs/router
pnpm add @tarojs/router

Overview

Taro-router

Index

Variables

variable history

let history: History;

    Functions

    function createMultiRouter

    createMultiRouter: (
    app: AppInstance,
    config: MpaRouterConfig,
    framework?: string
    ) => Promise<void>;
    • Note: 关于多页面应用 - 需要配置路由映射(根目录跳转、404 页面……) - app.onPageNotFound 事件不支持 - 应用生命周期可能多次触发 - TabBar 会多次加载 - 不支持路由动画

    function createRouter

    createRouter: (
    app: AppInstance,
    config: SpaRouterConfig,
    framework?: string
    ) => () => void;

      function getCurrentPages

      getCurrentPages: () => Taro.Page[];
        navigateBack: (
        option?: Taro.navigateBack.Option
        ) => ReturnType<typeof Taro.navigateBack>;
          navigateTo: (
          option: Taro.navigateTo.Option
          ) => ReturnType<typeof Taro.navigateTo>;

            function redirectTo

            redirectTo: (
            option: Taro.redirectTo.Option
            ) => ReturnType<typeof Taro.redirectTo>;

              function reLaunch

              reLaunch: (option: Taro.reLaunch.Option) => ReturnType<typeof Taro.reLaunch>;

                function switchTab

                switchTab: (option: Taro.switchTab.Option) => ReturnType<typeof Taro.switchTab>;

                  Package Files (5)

                  Dependencies (7)

                  Dev Dependencies (0)

                  No dev dependencies.

                  Peer Dependencies (0)

                  No peer dependencies.

                  Badge

                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@tarojs/router.

                  • Markdown
                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@tarojs/router)
                  • HTML
                    <a href="https://www.jsdocs.io/package/@tarojs/router"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>