完善组件

This commit is contained in:
ahua52 2017-03-07 16:28:34 +08:00
parent e46541bc65
commit 5034f9aeea
5 changed files with 9 additions and 52 deletions

View File

@ -3,7 +3,6 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AntTreeNode = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
@ -33,32 +32,6 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var AntTreeNodeProps = {
disabled: _react.PropTypes.bool,
disableCheckbox: _react.PropTypes.bool,
title: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.node]),
key: _react.PropTypes.string,
isLeaf: _react.PropTypes.bool
};
var AntTreeNode = exports.AntTreeNode = function (_Component) {
_inherits(AntTreeNode, _Component);
function AntTreeNode() {
_classCallCheck(this, AntTreeNode);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
AntTreeNode.prototype.render = function render() {
return _react2["default"].createElement(AntTreeNode, this.props);
};
return AntTreeNode;
}(_react.Component);
AntTreeNode.AntTreeNodeProps = AntTreeNodeProps;
var TreeProps = {
showLine: _react.PropTypes.bool,
className: _react.PropTypes.string,
@ -120,13 +93,13 @@ var defaultProps = {
openAnimation: _openAnimation2["default"]
};
var Tree = function (_Component2) {
_inherits(Tree, _Component2);
var Tree = function (_Component) {
_inherits(Tree, _Component);
function Tree() {
_classCallCheck(this, Tree);
return _possibleConstructorReturn(this, _Component2.apply(this, arguments));
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Tree.prototype.render = function render() {
@ -147,4 +120,5 @@ var Tree = function (_Component2) {
Tree.TreeNode = _TreeNode2["default"];
Tree.TreeProps = TreeProps;
Tree.defaultProps = defaultProps;
exports["default"] = Tree;
exports["default"] = Tree;
module.exports = exports['default'];

View File

@ -7,6 +7,7 @@
const defaultProps = {
keys: ['0-0-0', '0-0-1']
}
console.log(Tree);
class Demo1 extends Component {
constructor(props) {
super(props);

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "bee-tree",
"version": "0.0.1",
"version": "0.1.0",
"description": "Tree ui component for react",
"keywords": [
"react",

View File

@ -3,25 +3,6 @@ import RcTree from './Tree';
import TreeNode from './TreeNode';
import animation from './openAnimation';
const AntTreeNodeProps ={
disabled: PropTypes.bool,
disableCheckbox: PropTypes.bool,
title: PropTypes.oneOfType([
PropTypes.string,
PropTypes.node
]),
key: PropTypes.string,
isLeaf: PropTypes.bool
}
export class AntTreeNode extends Component {
render() {
return <AntTreeNode {...this.props} />;
}
}
AntTreeNode.AntTreeNodeProps = AntTreeNodeProps;
const TreeProps ={
showLine: PropTypes.bool,
className: PropTypes.string,