mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
read demo from demo folder
This commit is contained in:
parent
a346311d9e
commit
d83608dff4
14
components/select/demo/basic.md
Normal file
14
components/select/demo/basic.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# 基本型
|
||||||
|
|
||||||
|
- description: 你说什么我还是听不清。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
````html
|
||||||
|
<select>
|
||||||
|
<option>选项一</option>
|
||||||
|
<option>选项二</option>
|
||||||
|
<option>选项三</option>
|
||||||
|
</select>
|
||||||
|
````
|
||||||
|
|
@ -6,6 +6,7 @@ var CodeBox = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
|
this.props.src = this.props.src.replace(/\.md$/, '.html');
|
||||||
$.get('/' + this.props.src).then(function(data) {
|
$.get('/' + this.props.src).then(function(data) {
|
||||||
var item = $(data);
|
var item = $(data);
|
||||||
item.find('.highlight').appendTo(item);
|
item.find('.highlight').appendTo(item);
|
||||||
@ -23,7 +24,10 @@ var CodeBox = React.createClass({
|
|||||||
render: function() {
|
render: function() {
|
||||||
var html = this.state.html;
|
var html = this.state.html;
|
||||||
return (
|
return (
|
||||||
<div className="code-box" onClick={this.handleClick} dangerouslySetInnerHTML={{__html: html}}></div>
|
<div className="code-box"
|
||||||
|
onClick={this.handleClick}
|
||||||
|
dangerouslySetInnerHTML={{__html: html}}>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -379,7 +379,7 @@ footer ul li > a {
|
|||||||
|
|
||||||
.main-container {
|
.main-container {
|
||||||
width: calc(100% - 240px);
|
width: calc(100% - 240px);
|
||||||
padding: 30px 40px;
|
padding: 30px 40px 80px;
|
||||||
-webkit-animation: xRightMatrix .5s ease-out .5s backwards;
|
-webkit-animation: xRightMatrix .5s ease-out .5s backwards;
|
||||||
animation: xRightMatrix .5s ease-out .5s backwards;
|
animation: xRightMatrix .5s ease-out .5s backwards;
|
||||||
}
|
}
|
||||||
|
@ -97,8 +97,10 @@
|
|||||||
<script type="text/jsx">
|
<script type="text/jsx">
|
||||||
React.render(
|
React.render(
|
||||||
<CodeBoxes>
|
<CodeBoxes>
|
||||||
<CodeBox src="components/button/demo/basic.html"></CodeBox>
|
{%- set items = resource.pages|under(post.meta.directory) %}
|
||||||
<CodeBox src="components/button/demo/basic.html"></CodeBox>
|
{%- for item in items %}
|
||||||
|
<CodeBox src="{{item.meta.filepath}}"></CodeBox>
|
||||||
|
{%- endfor %}
|
||||||
</CodeBoxes>,
|
</CodeBoxes>,
|
||||||
document.getElementById('code-boxes')
|
document.getElementById('code-boxes')
|
||||||
);
|
);
|
||||||
|
@ -48,6 +48,17 @@ module.exports = function(nico) {
|
|||||||
}).filter(function(item) {
|
}).filter(function(item) {
|
||||||
return item;
|
return item;
|
||||||
}));
|
}));
|
||||||
|
},
|
||||||
|
under: function(pages, directory) {
|
||||||
|
var ret = [];
|
||||||
|
Object.keys(pages).forEach(function(key) {
|
||||||
|
var page = pages[key];
|
||||||
|
console.log(key, directory);
|
||||||
|
if (key.indexOf(directory + '/demo/') === 0) {
|
||||||
|
ret.push(page);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user