import React from 'react'; import ReactDOM from 'react-dom'; import { Link } from 'react-router'; import antd, { Collapse } from '../../../'; import BrowserDemo from '../BrowserDemo'; import * as utils from '../utils'; import hljs from 'highlight.js'; export default class Demo extends React.Component { constructor(props) { super(props); this.state = { activeKey: '', }; } handleChange(activeKey) { this.setState({ activeKey: this.state.activeKey === activeKey ? '' : activeKey }); } render() { const { id, parentId, preview, title, intro, code, style, expand, pathname } = this.props; const demoId = `${parentId}-${id}`; const introChildren = intro.map(utils.objectToComponent.bind(null, pathname)); const highlightedCode = hljs.highlight('javascript', code).value; return (
{ preview(React, ReactDOM, antd, BrowserDemo) } { !!style ?