clean warning

This commit is contained in:
yiminghe 2015-07-08 20:53:11 +08:00
parent 3c9b82a8bf
commit 0a7410973e
13 changed files with 57 additions and 49 deletions

View File

@ -37,8 +37,8 @@ var Test = React.createClass({
visible={this.state.visible}
title="对话框标题" onOk={this.handleOk} onCancel={this.handleCancel}
footer={[
<button className="ant-btn" onClick={this.handleCancel}>返 回</button>,
<button className="ant-btn ant-btn-primary" onClick={this.handleOk}>
<button key="back" className="ant-btn" onClick={this.handleCancel}>返 回</button>,
<button key="submit" className="ant-btn ant-btn-primary" onClick={this.handleOk}>
提 交
<i className={'anticon anticon-loading'+(this.state.loading?'':'hide')}></i>
</button>

View File

@ -44,8 +44,8 @@ var Modal = React.createClass({
render() {
var props = this.props;
var footer = props.footer || [
<button type="button" className="ant-btn-default ant-btn" onClick={this.handleCancel}> </button>,
<button type="button" className="ant-btn-primary ant-btn" onClick={this.handleOk}> </button>
<button key="cancel" type="button" className="ant-btn-default ant-btn" onClick={this.handleCancel}> </button>,
<button key="confirm" type="button" className="ant-btn-primary ant-btn" onClick={this.handleOk}> </button>
];
return <Dialog transitionName="zoom" onBeforeClose={props.onCancel} visible={this.state.visible} maskAnimation="fade" width="500" footer={footer} {...props} ref="d"/>;
}

View File

@ -8,10 +8,10 @@
````jsx
var Popover = antd.Popover;
var content = [
<p>内容</p>,
var content = <div>
<p>内容</p>
];
<p>内容</p>
</div>;
React.render(
<Popover overlay={content} title="标题">

View File

@ -9,10 +9,10 @@
````jsx
var Popover = antd.Popover;
var text = <span>标题</span>;
var content = [
<p>内容</p>,
var content = <div>
<p>内容</p>
];
<p>内容</p>
</div>;
React.render(<div>
<Popover placement="left" title={text} overlay={content}>

View File

@ -8,10 +8,10 @@
````jsx
var Popover = antd.Popover;
var content = [
<p>内容</p>,
var content = <div>
<p>内容</p>
];
<p>内容</p>
</div>;
React.render(<div>
<Popover overlay={content} title="标题" trigger="hover">

View File

@ -3,6 +3,7 @@
var Progressline = require('rc-progress').Line;
var Progresscircle = require('rc-progress').Circle;
var React = require('react');
var assign = require('object-assign');
var Line = React.createClass({
getDefaultProps() {
@ -20,28 +21,30 @@ var Line = React.createClass({
'success': '#85D262'
};
if (parseInt(this.props.percent) === 100) {
this.props.status = 'success';
var props = assign({}, this.props);
if (parseInt(props.percent) === 100) {
props.status = 'success';
}
var style = {
'width': this.props.width
'width': props.width
};
var fontSize = (this.props.width / 100 * this.props.strokeWidth);
var fontSize = (props.width / 100 * props.strokeWidth);
var iconStyle = {
'font-size': (fontSize < 14) ? 14 : fontSize
'fontSize': (fontSize < 14) ? 14 : fontSize
};
var textStyle = {
'color': statusColorMap[this.props.status]
'color': statusColorMap[props.status]
};
var progressInfo;
if (this.props.status === 'exception') {
if (props.status === 'exception') {
progressInfo = (
<span style={textStyle} className='ant-progress-line-text'>
<i style={iconStyle} className="anticon anticon-exclamation-circle"></i>
</span>
);
} else if (this.props.status === 'success') {
} else if (props.status === 'success') {
progressInfo = (
<span style={textStyle} className='ant-progress-line-text'>
<i style={iconStyle} className="anticon anticon-check-circle"></i>
@ -49,15 +52,15 @@ var Line = React.createClass({
);
} else {
progressInfo = (
<span className='ant-progress-line-text'>{this.props.percent}%</span>
<span className='ant-progress-line-text'>{props.percent}%</span>
);
}
return (
<div className='ant-progress-line-wrap'>
<div className='ant-progress-line-inner' style={style}>
<Progressline percent={this.props.percent} strokeWidth={this.props.strokeWidth}
strokeColor={statusColorMap[this.props.status]} trailColor="#e9e9e9" />
<Progressline percent={props.percent} strokeWidth={props.strokeWidth}
strokeColor={statusColorMap[props.status]} trailColor="#e9e9e9" />
</div>
{progressInfo}
</div>
@ -81,28 +84,30 @@ var Circle = React.createClass({
'success': '#85D262'
};
if (parseInt(this.props.percent) === 100) {
this.props.status = 'success';
var props = assign({}, this.props);
if (parseInt(props.percent) === 100) {
props.status = 'success';
}
var style = {
'width': this.props.width,
'height': this.props.width
'width': props.width,
'height': props.width
};
var wrapStyle = {
'font-size': this.props.width * 0.16 + 6
'fontSize': props.width * 0.16 + 6
};
var textStyle = {
'color': statusColorMap[this.props.status]
'color': statusColorMap[props.status]
};
var progressInfo;
if (this.props.status === 'exception') {
if (props.status === 'exception') {
progressInfo = (
<span style={textStyle} className='ant-progress-circle-text'>
<i className='anticon anticon-exclamation'></i>
</span>
);
} else if (this.props.status === 'success') {
} else if (props.status === 'success') {
progressInfo = (
<span style={textStyle} className='ant-progress-circle-text'>
<i className="anticon anticon-check"></i>
@ -110,15 +115,15 @@ var Circle = React.createClass({
);
} else {
progressInfo = (
<span className="ant-progress-circle-text">{this.props.percent}%</span>
<span className="ant-progress-circle-text">{props.percent}%</span>
);
}
return (
<div className="ant-progress-circle-wrap" style={wrapStyle}>
<div className="ant-progress-circle-inner" style={style}>
<Progresscircle percent={this.props.percent} strokeWidth={this.props.strokeWidth}
strokeColor={statusColorMap[this.props.status]} trailColor="#e9e9e9" />
<Progresscircle percent={props.percent} strokeWidth={props.strokeWidth}
strokeColor={statusColorMap[props.status]} trailColor="#e9e9e9" />
{progressInfo}
</div>
</div>

View File

@ -16,10 +16,10 @@ function handleChange(value) {
React.render(
<Select value="lucy" style={{width:200}} onChange={handleChange}>
<Option value="jack">jack</Option>
<Option value="lucy">lucy</Option>
<Option value="disabled" disabled>disabled</Option>
<Option value="yiminghe">yiminghe</Option>
<Option key="jack" value="jack">jack</Option>
<Option key="lucy" value="lucy">lucy</Option>
<Option key="disabled" value="disabled" disabled>disabled</Option>
<Option key="yiminghe" value="yiminghe">yiminghe</Option>
</Select>
, document.getElementById('components-select-demo-basic'));
````

View File

@ -24,7 +24,7 @@ var Test = React.createClass({
} else {
options = ['gmail.com', '163.com', 'qq.com'].map(function(domain) {
var email = value + '@' + domain;
return <Option value={email}>{email}</Option>;
return <Option key={email} value={email}>{email}</Option>;
});
}
this.setState({

View File

@ -13,7 +13,7 @@ var Option = Select.Option;
var children = [];
for (var i = 10; i < 36; i++) {
children.push(<Option value={i.toString(36) + i}>{i.toString(36) + i}</Option>);
children.push(<Option value={i.toString(36) + i} key={i.toString(36) + i}>{i.toString(36) + i}</Option>);
}
function handleChange(value) {

View File

@ -16,10 +16,10 @@ function handleChange(value) {
React.render(
<Select value="lucy" showSearch={true} style={{width:200}} onChange={handleChange}>
<Option value="jack">jack</Option>
<Option value="lucy">lucy</Option>
<Option value="disabled" disabled>disabled</Option>
<Option value="yiminghe">yiminghe</Option>
<Option key="jack" value="jack">jack</Option>
<Option key="lucy" value="lucy">lucy</Option>
<Option key="disabled" value="disabled" disabled>disabled</Option>
<Option key="yiminghe" value="yiminghe">yiminghe</Option>
</Select>
, document.getElementById('components-select-demo-search'));
````

View File

@ -13,7 +13,7 @@ var Option = Select.Option;
var children = [];
for (var i = 10; i < 36; i++) {
children.push(<Option value={i.toString(36) + i}>{i.toString(36) + i}</Option>);
children.push(<Option value={i.toString(36) + i} key={i.toString(36) + i}>{i.toString(36) + i}</Option>);
}
function handleChange(value) {

View File

@ -17,3 +17,5 @@ module.exports = React.createClass({
);
}
});
module.exports.Option = Select.Option;

View File

@ -14,16 +14,17 @@
"dependencies": {
"gregorian-calendar": "~3.0.0",
"gregorian-calendar-format": "~3.0.1",
"object-assign": "~3.0.0",
"rc-calendar": "~3.10.0",
"rc-dialog": "~4.3.5",
"rc-dialog": "~4.4.0",
"rc-dropdown": "~1.1.1",
"rc-input-number": "~2.0.0",
"rc-menu": "~3.4.0",
"rc-progress": "~1.0.0",
"rc-select": "~4.0.0",
"rc-select": "~4.2.0",
"rc-steps": "~1.1.3",
"rc-switch": "~1.1.0",
"rc-tabs": "~5.1.0",
"rc-tabs": "~5.2.0",
"rc-tooltip": "~2.4.0"
},
"devDependencies": {