mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
fix boolean attribute lint errors
This commit is contained in:
parent
16abf46071
commit
d1d3329674
@ -31,7 +31,6 @@
|
||||
"no-undef": 2,
|
||||
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
|
||||
"babel/object-shorthand": 0,
|
||||
"react/jsx-boolean-value": 0,
|
||||
"react/jsx-no-duplicate-props": 2,
|
||||
"react/sort-comp": 0,
|
||||
"react/wrap-multilines": 0,
|
||||
|
@ -10,10 +10,10 @@
|
||||
import { Badge, Icon } from 'antd';
|
||||
|
||||
ReactDOM.render(<div>
|
||||
<Badge dot={true}>
|
||||
<Badge dot>
|
||||
<Icon type="notification" />
|
||||
</Badge>
|
||||
<Badge dot={true}>
|
||||
<Badge dot>
|
||||
<a href="#">一个链接</a>
|
||||
</Badge>
|
||||
</div>, document.getElementById('components-badge-demo-dot'));
|
||||
|
@ -28,7 +28,7 @@ class AntBadge extends React.Component {
|
||||
<Animate component=""
|
||||
showProp="data-show"
|
||||
transitionName={prefixCls + '-zoom'}
|
||||
transitionAppear={true}>
|
||||
transitionAppear>
|
||||
{
|
||||
hidden ? null :
|
||||
<ScrollNumber data-show={!hidden} className={className} count={count} />
|
||||
|
@ -22,13 +22,13 @@ const App = React.createClass({
|
||||
},
|
||||
render() {
|
||||
return <div>
|
||||
<Button type="primary" size="large" loading={true}>
|
||||
<Button type="primary" size="large" loading>
|
||||
加载中
|
||||
</Button>
|
||||
<Button type="primary" loading={true}>
|
||||
<Button type="primary" loading>
|
||||
加载中
|
||||
</Button>
|
||||
<Button type="primary" size="small" loading={true}>
|
||||
<Button type="primary" size="small" loading>
|
||||
加载中
|
||||
</Button>
|
||||
<br />
|
||||
|
@ -1,4 +1,4 @@
|
||||
# 不可用
|
||||
不可用
|
||||
|
||||
- order: 1
|
||||
|
||||
@ -11,8 +11,8 @@ import { Checkbox } from 'antd';
|
||||
const container = document.getElementById('components-checkbox-demo-disable');
|
||||
|
||||
ReactDOM.render(<div>
|
||||
<Checkbox defaultChecked={false} disabled={true}/>
|
||||
<Checkbox defaultChecked={false} disabled />
|
||||
<br />
|
||||
<Checkbox defaultChecked={true} disabled={true}/>
|
||||
<Checkbox defaultChecked disabled />
|
||||
</div>, container);
|
||||
````
|
||||
|
@ -17,7 +17,7 @@ const text = `
|
||||
`;
|
||||
|
||||
ReactDOM.render(
|
||||
<Collapse accordion={true}>
|
||||
<Collapse accordion>
|
||||
<Panel header={`This is panel header 1`} key="1">
|
||||
<p>{text}</p>
|
||||
</Panel>
|
||||
|
@ -21,7 +21,7 @@ const text = `
|
||||
`;
|
||||
|
||||
ReactDOM.render(
|
||||
<Collapse onChange={callback} accordion={true}>
|
||||
<Collapse onChange={callback} accordion>
|
||||
<Panel header={`This is panel header 1`} key="1">
|
||||
<Collapse defaultActiveKey="1">
|
||||
<Panel header={`This is panel nest panel`} key="1">
|
||||
|
@ -10,6 +10,6 @@
|
||||
import { Datepicker } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Datepicker defaultValue="2015-06-06" disabled={true} />
|
||||
<Datepicker defaultValue="2015-06-06" disabled />
|
||||
, document.getElementById('components-datepicker-demo-disabled'));
|
||||
````
|
||||
|
@ -22,7 +22,7 @@ const App = React.createClass({
|
||||
};
|
||||
},
|
||||
render() {
|
||||
return <Datepicker showTime={true} locale={this.state.locale} />;
|
||||
return <Datepicker locale={this.state.locale} />;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -105,7 +105,7 @@ function createPicker(TheCalendar) {
|
||||
showTime={this.props.showTime}
|
||||
prefixCls="ant-calendar"
|
||||
showOk={this.props.showTime}
|
||||
showClear={true}/>
|
||||
showClear />
|
||||
);
|
||||
|
||||
let sizeClass = '';
|
||||
|
@ -28,7 +28,7 @@ ReactDOM.render(
|
||||
label="用户名:"
|
||||
labelCol={{span:5}}
|
||||
wrapperCol={{span:12}}
|
||||
required={true} >
|
||||
required>
|
||||
<p className="ant-form-text">大眼萌 minion</p>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
@ -36,7 +36,7 @@ ReactDOM.render(
|
||||
label="密码:"
|
||||
labelCol={{span:5}}
|
||||
wrapperCol={{span:12}}
|
||||
required={true} >
|
||||
required>
|
||||
<Input type="password" defaultValue="123456" id="password" />
|
||||
</FormItem>
|
||||
<Row>
|
||||
|
@ -60,7 +60,7 @@ ReactDOM.render(
|
||||
<Checkbox />选项二
|
||||
</label>
|
||||
<label className="ant-checkbox-vertical">
|
||||
<Checkbox disabled={true} />选项三(不可选)
|
||||
<Checkbox disabled />选项三(不可选)
|
||||
</label>
|
||||
</FormItem>
|
||||
|
||||
|
@ -46,7 +46,7 @@ const Demo = React.createClass({
|
||||
label="用户名:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 6}}
|
||||
required={true} >
|
||||
required>
|
||||
<p className="ant-form-text" id="userName" name="userName">大眼萌 minion</p>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
@ -54,14 +54,14 @@ const Demo = React.createClass({
|
||||
label="密码:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}
|
||||
required={true} >
|
||||
required>
|
||||
<Input type="password" id="password" name="password" placeholder="请输入密码" value={formData.password} onChange={this.setValue.bind(this, 'password')} />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="您的性别:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}
|
||||
required={true} >
|
||||
required>
|
||||
<RadioGroup name="gender" value={formData.gender} onChange={this.setValue.bind(this, 'gender')} >
|
||||
<Radio value="male">男的</Radio>
|
||||
<Radio value="female">女的</Radio>
|
||||
@ -72,8 +72,8 @@ const Demo = React.createClass({
|
||||
label="备注:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}
|
||||
required={true}
|
||||
help="随便写点什么" >
|
||||
required
|
||||
help="随便写点什么">
|
||||
<Input type="textarea" placeholder="随便写" id="remark" name="remark" value={formData.remark} onChange={this.setValue.bind(this, 'remark')} />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
|
@ -46,7 +46,7 @@ const Demo = React.createClass({
|
||||
label="InputNumber 数字输入框:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 10}}
|
||||
required={true} >
|
||||
required>
|
||||
<InputNumber size="large" min={1} max={10} style={{width:100}} defaultValue={3} name="inputNumber" onChange={this.setValue.bind(this, 'inputNumber')} value={formData.inputNumber} />
|
||||
<span className="ant-form-text"> 台机器</span>
|
||||
</FormItem>
|
||||
@ -55,7 +55,7 @@ const Demo = React.createClass({
|
||||
label="我是标题:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 10}}
|
||||
required={true} >
|
||||
required>
|
||||
<p className="ant-form-text" id="static" name="static">唧唧复唧唧木兰当户织呀</p>
|
||||
<p className="ant-form-text">
|
||||
<a href="#">链接文字</a>
|
||||
@ -66,7 +66,7 @@ const Demo = React.createClass({
|
||||
label="Switch 开关:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 10}}
|
||||
required={true} >
|
||||
required>
|
||||
<Switch name="switch" onChange={this.setValue.bind(this, 'switch')} value={formData.switch} />
|
||||
</FormItem>
|
||||
|
||||
@ -74,7 +74,7 @@ const Demo = React.createClass({
|
||||
label="Slider 滑动输入条:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 10}}
|
||||
required={true}>
|
||||
required>
|
||||
<Slider marks={['A', 'B', 'C', 'D', 'E', 'F', 'G']} name="slider" onChange={this.setValue.bind(this, 'slider')} />
|
||||
</FormItem>
|
||||
|
||||
@ -82,7 +82,7 @@ const Demo = React.createClass({
|
||||
label="Select 选择器:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 16}}
|
||||
required={true}>
|
||||
required>
|
||||
<Select size="large" defaultValue="lucy" style={{width:200}} name="select" onChange={this.setValue.bind(this, 'select')} value={formData.select}>
|
||||
<Option value="jack">jack</Option>
|
||||
<Option value="lucy">lucy</Option>
|
||||
@ -94,7 +94,7 @@ const Demo = React.createClass({
|
||||
<FormItem
|
||||
label="Datepicker 日期选择框:"
|
||||
labelCol={{span: 8}}
|
||||
required={true}>
|
||||
required>
|
||||
<Col span="6">
|
||||
<Datepicker name="startDate" onChange={this.setValue.bind(this, 'startDate')} value={formData.startDate} />
|
||||
</Col>
|
||||
|
@ -39,7 +39,7 @@ ReactDOM.render(
|
||||
label="校验中:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
hasFeedback={true}
|
||||
hasFeedback
|
||||
validateStatus="validating"
|
||||
help="信息审核中...">
|
||||
<Input defaultValue="我是被校验的内容" id="validating" />
|
||||
@ -49,7 +49,7 @@ ReactDOM.render(
|
||||
label="成功校验:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
hasFeedback={true}
|
||||
hasFeedback
|
||||
validateStatus="success">
|
||||
<Input defaultValue="我是正文" id="success" />
|
||||
</FormItem>
|
||||
@ -58,7 +58,7 @@ ReactDOM.render(
|
||||
label="警告校验:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
hasFeedback={true}
|
||||
hasFeedback
|
||||
validateStatus="warning">
|
||||
<Input defaultValue="前方高能预警" id="warning" />
|
||||
</FormItem>
|
||||
@ -67,7 +67,7 @@ ReactDOM.render(
|
||||
label="失败校验:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
hasFeedback={true}
|
||||
hasFeedback
|
||||
validateStatus="error"
|
||||
help="请输入数字和字母组合">
|
||||
<Input defaultValue="无效选择" id="error" />
|
||||
|
@ -91,7 +91,7 @@ export default function (props) {
|
||||
ReactDOM.render(<Dialog
|
||||
prefixCls="ant-modal"
|
||||
className="ant-confirm"
|
||||
visible={true}
|
||||
visible
|
||||
closable={false}
|
||||
title=""
|
||||
transitionName="zoom"
|
||||
|
@ -18,6 +18,6 @@ function onShowSizeChange(current, pageSize) {
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<Pagination showSizeChanger={true} onShowSizeChange={onShowSizeChange} onChange={onChange} total={500} />,
|
||||
<Pagination showSizeChanger onShowSizeChange={onShowSizeChange} onChange={onChange} total={500} />,
|
||||
document.getElementById('components-pagination-demo-changer'));
|
||||
````
|
||||
|
@ -14,6 +14,6 @@ function onChange(page) {
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<Pagination showQuickJumper={true} onChange={onChange} total={500} />,
|
||||
<Pagination showQuickJumper onChange={onChange} total={500} />,
|
||||
document.getElementById('components-pagination-demo-jump'));
|
||||
````
|
||||
|
@ -27,7 +27,7 @@ const Test = React.createClass({
|
||||
<p className="buttons">
|
||||
<Button type="primary" onClick={this.onClick}>切换</Button>
|
||||
</p>
|
||||
<QueueAnim component="form" className="ant-form-horizontal" type="bottom" leaveReverse={true}>
|
||||
<QueueAnim component="form" className="ant-form-horizontal" type="bottom" leaveReverse>
|
||||
{this.state.show ? [
|
||||
<div className="ant-form-item ant-form-item-compact" key="name">
|
||||
<label htmlFor="userName" className="col-6" required>用户名:</label>
|
||||
|
@ -24,7 +24,7 @@ const App = React.createClass({
|
||||
return <div>
|
||||
<Radio defaultChecked={false} disabled={this.state.disabled}>不可用</Radio>
|
||||
<br />
|
||||
<Radio defaultChecked={true} disabled={this.state.disabled}>不可用</Radio>
|
||||
<Radio defaultChecked disabled={this.state.disabled}>不可用</Radio>
|
||||
<div style={{marginTop: 20}}>
|
||||
<Button type="primary" onClick={this.toggleDisabled}>
|
||||
Toggle disabled
|
||||
|
@ -15,7 +15,7 @@ function handleChange(value) {
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<Select defaultValue="lucy" showSearch={true} style={{width:200}}
|
||||
<Select defaultValue="lucy" showSearch style={{width:200}}
|
||||
searchPlaceholder="输入"
|
||||
onChange={handleChange}>
|
||||
<Option value="jack">jack</Option>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
- order: 10
|
||||
|
||||
添加表格边框线,`bordered={true}`。
|
||||
添加表格边框线,`bordered`。
|
||||
|
||||
---
|
||||
|
||||
@ -41,7 +41,7 @@ const data = [{
|
||||
address: '西湖区湖底公园1号'
|
||||
}];
|
||||
|
||||
ReactDOM.render(<Table columns={columns} dataSource={data} bordered={true} />
|
||||
ReactDOM.render(<Table columns={columns} dataSource={data} bordered />
|
||||
, document.getElementById('components-table-demo-bordered'));
|
||||
````
|
||||
|
||||
|
@ -115,6 +115,6 @@ const data = [{
|
||||
address: '西湖区湖底公园1号'
|
||||
}];
|
||||
|
||||
ReactDOM.render(<Table columns={columns} dataSource={data} bordered={true} />
|
||||
ReactDOM.render(<Table columns={columns} dataSource={data} bordered />
|
||||
, document.getElementById('components-table-demo-colspan-rowspan'));
|
||||
````
|
||||
|
@ -15,7 +15,7 @@ function callback(key) {}
|
||||
ReactDOM.render(
|
||||
<Tabs defaultActiveKey="1" onChange={callback}>
|
||||
<TabPane tab="选项卡一" key="1">选项卡一</TabPane>
|
||||
<TabPane tab="选项卡二" disabled={true} key="2">选项卡二</TabPane>
|
||||
<TabPane tab="选项卡二" disabled key="2">选项卡二</TabPane>
|
||||
<TabPane tab="选项卡三" key="3">选项卡三</TabPane>
|
||||
</Tabs>
|
||||
, document.getElementById('components-tabs-demo-disabled'));
|
||||
|
@ -11,7 +11,7 @@ import { Timeline } from 'antd';
|
||||
const container = document.getElementById('components-timeline-demo-pending');
|
||||
|
||||
ReactDOM.render(
|
||||
<Timeline pending={true}>
|
||||
<Timeline pending>
|
||||
<Timeline.Item>创建服务现场 2015-09-01</Timeline.Item>
|
||||
<Timeline.Item>初步排除网络异常 2015-09-01</Timeline.Item>
|
||||
<Timeline.Item>技术测试异常 2015-09-01</Timeline.Item>
|
||||
|
@ -15,7 +15,7 @@ function handleCheck(info) {
|
||||
}
|
||||
|
||||
ReactDOM.render(<div>
|
||||
<Tree defaultExpandAll={true} checkable={true} onCheck={handleCheck}>
|
||||
<Tree defaultExpandAll checkable onCheck={handleCheck}>
|
||||
<TreeNode title="parent 1">
|
||||
<TreeNode title="leaf" />
|
||||
<TreeNode title="parent 1-1">
|
||||
|
@ -43,7 +43,7 @@ class TreeDemo extends React.Component {
|
||||
}
|
||||
render() {
|
||||
return (<div>
|
||||
<Tree defaultExpandAll={true} checkable={true}
|
||||
<Tree defaultExpandAll checkable
|
||||
onCheck={this.handleCheck} checkedKeys={this.state.checkedKeys}
|
||||
onSelect={this.handleSelect} selectedKeys={this.state.selectedKeys} multiple>
|
||||
<TreeNode title="parent 1" key="p1">
|
||||
|
Loading…
Reference in New Issue
Block a user