0.1.8 • Published 9 years ago

dd-rc-nstree v0.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
9 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

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago