import React from 'react';
import { Row, Col } from '../../../';
import Demo from '../Demo';
import * as utils from '../utils';
export default class ComponentDoc extends React.Component {
render() {
const { demos = [], doc } = this.props;
const isSingleCol = doc.meta.cols === '1';
const leftChildren = [];
const rightChildren = [];
demos.forEach((demoData, index) => {
if (index % 2 === 0 || isSingleCol) {
leftChildren.push();
} else {
rightChildren.push();
}
});
return (
{doc.meta.title}
{ doc.description.map(utils.objectToComponent) }
代码演示
{ leftChildren }
{ isSingleCol ? null : { rightChildren } }
{ doc.api.map(utils.objectToComponent) }
);
}
}