# chanjet-plugin-navigation

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

Latest version **1.0.0** (published 2016-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install chanjet-plugin-navigation
pnpm add chanjet-plugin-navigation
yarn add chanjet-plugin-navigation
bun add chanjet-plugin-navigation
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-09-13 |
| First published | 2016-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | TonyJiang |
| Maintainers | chanjetsdp |

## Links

- npm: https://www.npmjs.com/package/chanjet-plugin-navigation
- npm.io page: https://npm.io/package/chanjet-plugin-navigation

## Dependencies (2)

- [chanjet-env-check](https://npm.io/package/chanjet-env-check.md) 1.0.0
- [chanjet-plugin-base](https://npm.io/package/chanjet-plugin-base.md) 1.0.0

## Recent versions

- 1.0.0 (latest) — 2016-09-13
- 0.0.7 — 2016-09-08

## README

# 定位API  `chanjet-plugin-navigation`

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

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



## 获取实例

```javascript
//通过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 导航栏的返回

   ​



## 用法

```javascript
//获取插件实例
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();
```

---
_Source: https://npm.io/package/chanjet-plugin-navigation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
