Socket
Socket
Sign inDemoInstall

san-router

Package Overview
Dependencies
0
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    san-router

Router for San


Version published
Weekly downloads
127
decreased by-14.77%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

2.0.0

  • [change] 删除路由相关组件的 route 数据项中的 config 属性
  • [change] 删除 router 监听器的第二参数 config。可由第一参数的属性 eventArg.config 获得匹配路由的配置项
  • [feature] router.add 方法支持数组参数,批量添加路由
  • [feature] 增加 withRoute 方法,支持内层组件的路由感知
  • [feature] 增加 createLink 方法,支持创建非默认路由的 Link 组件
  • [fix] 当路由 listener 中调用暂停再恢复时,异步组件初始化多次

Readme

Source

san-router

NPM version License

San 框架的官方 router,支持动态路由,嵌套路由,路由懒加载以及导航守卫等功能。

注意:使用 san-router,要求 San 的版本号 >= 3.0.2

文档 | 示例项目

下载

# use npm
npm i san-router
# or use yarn
yarn add san-router

使用

如需了解更多功能,请访问 快速开始

import {router, Link} from 'san-router';

router.add({
    rule: '/book',
    Component: BookDetail
});
router.add([
    {
        rule: '/about',
        Component: About
    },
    {
        rule: '/home',
        Component: Home
    }
]);
router.start();

CHANGELOG

CHANGELOG

License

san-router is MIT licensed.

FAQs

Last updated on 05 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc