afc163
10 years ago
7 changed files with 68 additions and 8 deletions
@ -1,5 +0,0 @@ |
|||
# 基本型 |
|||
|
|||
--- |
|||
|
|||
<button></button> |
@ -0,0 +1,9 @@ |
|||
# 基本型 |
|||
|
|||
- description: 你说什么我听不清。 |
|||
|
|||
--- |
|||
|
|||
````html |
|||
<button>按钮</button> |
|||
```` |
@ -1,6 +1,32 @@ |
|||
/*jshint ignore:start */ |
|||
var CodeBox = React.createClass({ |
|||
getInitialState: function() { |
|||
return { |
|||
html: '' |
|||
}; |
|||
}, |
|||
componentDidMount: function() { |
|||
var that = this; |
|||
$.get('/' + this.props.src).then(function(data) { |
|||
that.setState({ |
|||
html: data |
|||
}); |
|||
}); |
|||
}, |
|||
render: function() { |
|||
return <pre><code>{this.props.code}</code></pre>; |
|||
var html = this.state.html; |
|||
return ( |
|||
<div className="code-box" dangerouslySetInnerHTML={{__html: html}}></div> |
|||
); |
|||
} |
|||
}); |
|||
|
|||
var CodeBoxes = React.createClass({ |
|||
render: function() { |
|||
return ( |
|||
<div className="code-boxes"> |
|||
{this.props.children} |
|||
</div> |
|||
); |
|||
} |
|||
}); |
|||
|
@ -0,0 +1,5 @@ |
|||
<div class="code-box-container"> |
|||
{{ post.html }} |
|||
<h4 class="code-box-title">{{ post.title }}</h4> |
|||
<p class="code-box-description">{{ post.meta.description }}</p> |
|||
</div> |
Loading…
Reference in new issue