# ca-comp-sidebar

> basic react component

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

## Install

```sh
npm install ca-comp-sidebar
pnpm add ca-comp-sidebar
yarn add ca-comp-sidebar
bun add ca-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.10 |
| Published | 2019-11-20 |
| First published | 2018-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 31.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | FrendEr |
| Maintainers | frend.wong, youhuakun |
| Keywords | react, component |

## Links

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

## Dependencies (1)

- [comp-sidebar](https://npm.io/package/comp-sidebar.md) ^1.0.19

## 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.10 (latest) — 2019-11-20
- 1.0.9 — 2019-11-20
- 1.0.8 — 2019-11-20
- 1.0.7 — 2019-05-09
- 1.0.6 — 2019-05-09
- 1.0.5 — 2019-01-30
- 1.0.4 — 2019-01-30
- 1.0.3 — 2018-08-23
- 1.0.2 — 2018-08-23
- 1.0.1 — 2018-08-20
- 1.0.0 — 2018-07-21
- 0.0.8 — 2018-07-10
- 0.0.7 — 2018-07-10
- 0.0.6 — 2018-05-30
- 0.0.5 — 2018-03-28
- … 4 more at https://npm.io/package/ca-comp-sidebar/versions

## README

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

## API

| 属性 | 说明 | 类型 | 默认值 |
| ---- | ---- | ---- | ---- |
| dataSource | 源数据 | Array | |
| openKeys | 初始展开的 SubMenu 菜单项 key 数组 | Array | |
| selectedKeys | 初始选中的菜单项 key 数组 | Array | |

## Example

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

const data = {
  entries: [
    {
      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'
        }
      ]
    }
  ],
  openKeys: ['hotel'],
  selectedKeys: ['key1']
};

render(
  <Layout style={{height: '100vh'}}>
    <Sidebar {...data} />
  </Layout>,
  document.getElementById('app')
);

```

## Develop

```
$ npm run start
```

## Publish

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

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