# comp-sidebar

> basic react component

Latest version **1.0.23** (published 2019-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install comp-sidebar
pnpm add comp-sidebar
yarn add comp-sidebar
bun add comp-sidebar
```

## 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.23 |
| Published | 2019-11-20 |
| First published | 2018-01-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | FrendEr |
| Maintainers | frend.wong, youhuakun |
| Keywords | react, component |

## Links

- npm: https://www.npmjs.com/package/comp-sidebar
- npm.io page: https://npm.io/package/comp-sidebar

## Dependencies (1)

- [js-cookie](https://npm.io/package/js-cookie.md) ^2.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.23 (latest) — 2019-11-20
- 1.0.22 — 2019-07-01
- 1.0.21 — 2019-05-22
- 1.0.20 — 2019-05-09
- 1.0.19 — 2019-05-08
- 1.0.18 — 2019-04-24
- 1.0.10 — 2019-02-21
- 1.0.9 — 2019-01-30
- 1.0.8 — 2019-01-18
- 1.0.7 — 2019-01-18
- 1.0.6 — 2019-01-18
- 1.0.5 — 2019-01-18
- 1.0.4 — 2019-01-08
- 1.0.3 — 2018-08-23
- 1.0.2 — 2018-08-23
- … 13 more at https://npm.io/package/comp-sidebar/versions

## README

# comp-sidebar [![image](https://img.shields.io/npm/v/comp-sidebar.svg)](https://www.npmjs.com/package/comp-sidebar)


## API

| 属性 | 说明 | 类型 | 默认值 |
| ---- | ---- | ---- | ---- |
| logoUrl | logo 链接 | String | |
| openMode | 新页面打开方式，同 [a.target](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/a#attr-target) | String | _blank |
| dataSource | 源数据 | Array | |
| openKeys | 初始展开的 SubMenu 菜单项 key 数组 | Array | |
| selectedKeys | 初始选中的菜单项 key 数组 | Array | |
| theme | 主题颜色，支持 `dark` 或者 `light` | String | dark |

## Example

```
import React from 'react';
import { render } from 'react-dom';
import { Layout } from 'antd';
import CompSidebar from 'comp-sidebar';

const data = [
  {
    title: '酒店业务',
    key: 'hotel',
    entries: [
      {
        title: '酒店产品',
        key: 'key1',
        link: 'link1.html'
      },
      {
        title: '渠道运营',
        key: 'key2',
        link: 'link2.html'
      },
      {
        title: '订单管理',
        key: 'key3',
        link: 'order.html'
      }
    ]
  },
  {
    title: '合作伙伴',
    key: 'partner',
    entries: [
      {
        title: '供应商管理',
        key: 'key3',
        link: 'link3.html'
      },
      {
        title: '分销商管理',
        key: 'key4',
        link: 'link4.html'
      }
    ]
  }
];

render(
  <Layout style={{height: '100%'}}>
    <CompSidebar
      logoUrl="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
      dataSource={data}
      openKeys={['hotel']}
      selectedKeys={['key1']}
      theme="dark"
    />
  </Layout>,
  document.getElementById('app')
);
```

## Develop

```
$ npm run start
```

## Publish

```
$ cd ../..          // 返回项目根目录，通过 `lerna` 来构建与发布
$ npm run build
$ npm publish
```

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