site: fix iframe

This commit is contained in:
Benjy Cui 2016-05-11 11:36:47 +08:00
parent 2f81cc8111
commit 07c1ef05d3

View File

@ -3,6 +3,8 @@ import { Link } from 'react-router';
import classNames from 'classnames';
import * as utils from '../utils';
const isLocal = location.port;
export default class Demo extends React.Component {
constructor(props) {
super(props);
@ -39,7 +41,7 @@ export default class Demo extends React.Component {
<section className="code-box-demo">
{
meta.iframe ?
<iframe src={src} /> :
<iframe src={isLocal ? src : src.replace('./_site', '')} /> :
preview
}
{