0.1.8 • Published 8 years ago

dd-rc-nstree v0.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

dd-rc-nstree


基于 react + antd + zTree 定制的节点树。

安装

dd-rc-nstree

示例

import { Nstree } from 'dd-rc-nstree';

const App = React.createClass({
  nstreeBeforeInit(treeData) {
    return treeData.children[0];
  },
  render() {
    return  (
      <div className="nsTree-sidebar">
        <Nstree 
          beforeInit={this.nstreeBeforeInit}
          treeApi="http://127.0.0.1:8848/rig/worldtree/tree"
        />
      </div>
    );
  }
});

ReactDOM.render(<App />, document.getElementById('react-content'));

API

参数说明类型默认值
width宽度string、number200
height高度度string、number500
treeId节点树IDstring'nstree'
treeApi数据接口string''
zTreeObjSettingzTree配置object{}
beforeInit初始化前回调function(treeData)noop
afterInit初始化后回调function(zTreeObj)noop
searchsearch模块配置object

search

参数说明类型默认值
enabled是否开启搜索模块boolean
searchTypes搜索类型array
searchTypes = [{
  name: '搜索节点',
  type: 'ns'
}, {
  name: '搜索机器',
  type: 'machine'
}, {
  name: '搜索监控',
  type: 'collect'
}, {
  name: '初始化策略',
  type: 'init'
}, {
  name: '部署策略',
  type: 'deploy'
}]

refresh nsTree

$(document).trigger('refreshTree');

License

MIT

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago