2.0.2 • Published 4 years ago

bee-panel v2.0.2

Weekly downloads
334
License
MIT
Repository
github
Last release
4 years ago

bee-panel

npm version Build Status Coverage Status

Browser Support

IEChromeFirefoxOperaSafari
IE 9+ ✔Chrome 31.0+ ✔Firefox 31.0+ ✔Opera 30.0+ ✔Safari 7.0+ ✔

react bee-panel component for tinper-bee

展示板组件

使用方法

import {Panel} from 'bee-panel';

const title = (
  <h3>Panel title</h3>
)

ReactDOM.render(
    <Panel header={title} footer='Panel footer'>
      Panel content
    </Panel>
        , document.getElementById('target'));
import { Panel, PanelGroup } from 'bee-panel';

class Demo extends React.Component {
  constructor(...args) {
    super(...args);
    this.state = {
      activeKey: '1'
    };
    this.handleSelect = this.handleSelect.bind(this);
  }
  handleSelect(activeKey) {
    this.setState({ activeKey });
  }

  render() {
    return (
        <PanelGroup activeKey={this.state.activeKey} onSelect={this.handleSelect} accordion>
          <Panel header="Panel 1" eventKey="1">Panel 1 content</Panel>
          <Panel header="Panel 2" eventKey="2">Panel 2 content</Panel>
        </PanelGroup>
    );
  }
}

样式引入

  • 可以使用link引入build目录下Panel.css
<link rel="stylesheet" href="./node_modules/bee-panel/build/Panel.css">
  • 可以在js中import样式
import "./node_modules/bee-panel/src/Panel.scss"
//或是
import "./node_modules/bee-panel/build/Panel.css"

API

Panel

参数说明类型默认值
copyable是否可复制内容boolean-
collapsible是否添加折叠boolean-
onSelect有折叠效果时选中的效果function-
defaultExpanded默认是否打开booleanfalse
expanded折叠是否展开object-
onEnter开始显示时的钩子函数function-
onEntering显示时的钩子函数function-
onEntered显示完成后的钩子函数function-
onExit隐藏开始时的钩子函数function-
onExiting隐藏进行时的钩子函数function-
onExited隐藏结束时的钩子函数function-
header头部node-
headerStyle传递给头部的styleobject-
footer尾部node-
footerStyle传递给尾部的styleobject-
eventKey当多个panel存在时,每个panel的标记any-
colorspanel的颜色primary\accent\success\info\warning\danger\default\bordereddefault

PanelGroup

参数说明类型默认值
accordion是否是手风琴效果booleanfalse
activeKey当前展开的项any-
defaultActiveKey默认展开的项any-
onSelect选中的钩子函数function-
className传入的classany-
style传入的stylepbject-

开发调试

$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-panel
$ cd bee-panel
$ npm install
$ npm run dev
2.0.2

4 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.14

5 years ago

1.2.13

5 years ago

1.2.12

6 years ago

1.2.11

6 years ago

1.2.10

6 years ago

1.0.0

7 years ago

1.2.9

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago