{ content.meta.chinese || content.meta.english } { !content.meta.subtitle ? null : { content.meta.subtitle } }
{ !content.intro ? null : content.intro.map(utils.objectToComponent.bind(null, location.pathname)) } { jumper.length > 0 ?- { jumper }
import React from 'react'; import { Link } from 'react-router'; import ImagePreview from './ImagePreview'; import VideoPlayer from './VideoPlayer'; import * as utils from '../utils'; export default class Article extends React.Component { constructor(props) { super(props); this.imgToPreview = this.imgToPreview.bind(this); this.enhanceVideo = this.enhanceVideo.bind(this); } componentDidMount() { this.componentDidUpdate(); } componentDidUpdate() { const { chinese, english } = this.props.content.meta; utils.setTitle(`${chinese || english} - Ant Design`); } isPreviewImg(string) { return /^; } isVideo(string) { return /^; } render() { const { content, location } = this.props; const jumper = content.description.filter((node) => { return node.type === 'h2'; }).map((node) => { return (