npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chanjet-plugin-navigation

v1.0.0

Published

在mutants框架中, 提供设置导航的API接口 , 只在chanjet平台上可用, 微信不提供此功能.

Downloads

3

Readme

定位API chanjet-plugin-navigation

在mutants框架中, 提供设置导航的API接口 , 只在chanjet平台上可用, 微信不提供此功能.

不能脱离mutants框架单独使用.

获取实例

//通过mutants来获取插件实例
const plugin = mutants.plugin.navigation;

API

  1. update 更新导航栏设置

    参数
    • config Object 设置
      • backgroundColor string 导航栏背景色:#FFFFFFFF或#FFFFFF 6位或8位。注意Android端设置颜色不支持简写的#FFF
      • color string 文字和字体图标Normal状态下颜色
      • highlightColor string 文字和字体图标高亮颜色
      • disabledColor string 文字和字体图标禁用颜色
      • disabled bool RightButton可用状态,只有在type==button时有效
      • title string 标题
      • right Object 右侧配置
      • type string 右侧按钮类型“button”或“menu”
      • hide string 是否隐藏(只有右侧按钮有此属性)
      • item Object|Array 右侧按钮配置,当type为“menu”时item为数组(PopMenu信息)
      • text string 按钮文字
      • icon string 字体图标,注意当同时设置text和icon时只显示text
      • onClick function item点击事件
      • onBackClick function 返回事件
      • onCloseClick funtion 关闭事件

    详情参看Native文档TopBarPlugin.md

    返回值 void

  2. back 导航栏的返回

用法

//获取插件实例
const plugin = mutants.plugin.navigation;



/************** 更新导航栏配置 **************/
plugin.update({
	title: '标题',
  	backgroundColor: '#ffffff',
	color: '#888888',
  	right:{
      type: 'menu',
      item: [
        {
          text: '按钮1',
          onClick: function(){
            console.log('按钮1被点击');
          }
        },
        {
          text: '按钮2',
          onClick: function(){
            console.log('按钮2被点击');
          }
        }
      ]
  	},
	onBackClick: function(){
      console.log('导航栏返回被点击');
	},
  	onCloseClick: function(){
      console.log('关闭按钮被点击');
  	}
});



/************** 控制返回 **************/
//用于安卓捕获返回键时可以调用导航的处理
plugin.back();