New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dndc-medusa-wx-router

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dndc-medusa-wx-router

微信小程序统一路由功能函数

  • 1.1.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

medusa-wx-router

基于微信小程序路由功能 API 进行的二次封装函数,提供以同一 API 使用原生四种跳转能力的功能以及参数保真功能。

API 说明

routerTo

通用跳转函数,提供跳转与参数保真功能

参数

属性类型默认值必填说明
urlString-目标页面路径
typeStringpush跳转方式
queryObject-跳转参数
successFunction-跳转成功回调函数

示例

import mc from 'medusa-wx-router';
/** 完整调用方式 */
mc.routerTo({
  url: 'pages/home/index',
  type: 'push',
  query: {
    id: 0,
    bool: true
  },
  success: () => console.log('successfully'),
});
/** navigateTo API快捷形式 */
mc.routerTo('pages/home/index', {
  id: 0,
  bool: true
});

type 映射关系

typeAPI
pushnavigateTo
replaceredirectTo
reLaunchreLaunch
switchTabswitchTab

back

提供回退功能

参数

属性类型默认值必填说明
deltaNumber1回退步值

示例

mc.back(delta);

goHome

返回首页功能

示例

mc.goHome();

License

MIT

Keywords

FAQs

Package last updated on 11 Jul 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc