mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
style: update code style for object-curly-spacing
This commit is contained in:
parent
79aa53ce51
commit
cd1391e6a2
@ -29,7 +29,6 @@
|
||||
"react/jsx-closing-bracket-location": 0,
|
||||
"react/jsx-no-bind": 0,
|
||||
"space-before-function-paren": 0,
|
||||
"object-curly-spacing": 0,
|
||||
"no-param-reassign": 0,
|
||||
"max-len": 0,
|
||||
"object-shorthand": 0,
|
||||
|
@ -49,10 +49,10 @@ const Test = React.createClass({
|
||||
<a href="#" className="head-example"></a>
|
||||
</Badge>
|
||||
<div style={{ marginTop: 10 }}>
|
||||
<Button type="ghost" onClick={this.onNumberClick} style={{marginRight: 6}}>
|
||||
<Button type="ghost" onClick={this.onNumberClick} style={{ marginRight: 6 }}>
|
||||
切换数字显隐
|
||||
</Button>
|
||||
<Button type="ghost" onClick={this.onClick} style={{marginRight: 6}}>
|
||||
<Button type="ghost" onClick={this.onClick} style={{ marginRight: 6 }}>
|
||||
切换红点显隐
|
||||
</Button>
|
||||
<ButtonGroup>
|
||||
|
@ -13,7 +13,7 @@ import { Badge } from 'antd';
|
||||
|
||||
ReactDOM.render(<div>
|
||||
<Badge count={25} />
|
||||
<Badge count={4} style={{backgroundColor: '#fff', color: '#999', borderColor: '#d9d9d9'}} />
|
||||
<Badge count={109} style={{backgroundColor: '#87d068'}} />
|
||||
<Badge count={4} style={{ backgroundColor: '#fff', color: '#999', borderColor: '#d9d9d9' }} />
|
||||
<Badge count={109} style={{ backgroundColor: '#87d068' }} />
|
||||
</div>, mountNode);
|
||||
````
|
||||
|
@ -21,7 +21,7 @@ const App = React.createClass({
|
||||
(this.state.disabled ? '不可用' : '可用');
|
||||
return (
|
||||
<div>
|
||||
<p style={{marginBottom: '20px'}}>
|
||||
<p style={{ marginBottom: '20px' }}>
|
||||
<label>
|
||||
<Checkbox checked={this.state.checked}
|
||||
disabled={this.state.disabled}
|
||||
@ -34,7 +34,7 @@ const App = React.createClass({
|
||||
onClick={this.toggleChecked}>
|
||||
{!this.state.checked ? '选中' : '取消'}
|
||||
</Button>
|
||||
<Button style={{marginLeft: '10px'}}
|
||||
<Button style={{ marginLeft: '10px' }}
|
||||
type="primary" size="small"
|
||||
onClick={this.toggleDisable}>
|
||||
{!this.state.disabled ? '不可用' : '可用'}
|
||||
@ -44,10 +44,10 @@ const App = React.createClass({
|
||||
);
|
||||
},
|
||||
toggleChecked() {
|
||||
this.setState({checked: !this.state.checked});
|
||||
this.setState({ checked: !this.state.checked });
|
||||
},
|
||||
toggleDisable() {
|
||||
this.setState({disabled: !this.state.disabled});
|
||||
this.setState({ disabled: !this.state.disabled });
|
||||
},
|
||||
onChange(e) {
|
||||
console.log('checked = ', e.target.checked);
|
||||
|
@ -14,7 +14,7 @@ function onChange(value) {
|
||||
console.log('From: ', value[0], ', to: ', value[1]);
|
||||
}
|
||||
ReactDOM.render(<div>
|
||||
<RangePicker style={{width: 184}} onChange={onChange} />
|
||||
<RangePicker style={{ width: 184 }} onChange={onChange} />
|
||||
<br />
|
||||
<RangePicker showTime format="yyyy/MM/dd HH:mm:ss" onChange={onChange} />
|
||||
</div>, mountNode);
|
||||
|
@ -14,6 +14,6 @@ function onChange(value) {
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" onChange={onChange} style={{width: 160}} />
|
||||
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" onChange={onChange} style={{ width: 160 }} />
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
````jsx
|
||||
import { Menu, Dropdown, Icon } from 'antd';
|
||||
const onClick = function({key}) {
|
||||
const onClick = function({ key }) {
|
||||
console.log('点击了菜单' + key);
|
||||
};
|
||||
|
||||
|
@ -18,66 +18,66 @@ ReactDOM.render(
|
||||
<Col span="8">
|
||||
<FormItem
|
||||
label="搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="较长搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<FormItem
|
||||
label="搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="较长搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<FormItem
|
||||
label="搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="较长搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="搜索名称:"
|
||||
labelCol={{span: 10}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 10 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input placeholder="请输入搜索名称" />
|
||||
</FormItem>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span="8" offset="16" style={{textAlign: 'right'}}>
|
||||
<Col span="8" offset="16" style={{ textAlign: 'right' }}>
|
||||
<Button type="primary" htmlType="submit">搜索</Button>
|
||||
<Button type="ghost">清除条件</Button>
|
||||
</Col>
|
||||
|
@ -9,15 +9,15 @@
|
||||
---
|
||||
|
||||
````jsx
|
||||
import {Row, Col, Button, Input, Form} from 'antd';
|
||||
import { Row, Col, Button, Input, Form } from 'antd';
|
||||
const FormItem = Form.Item;
|
||||
|
||||
ReactDOM.render(
|
||||
<Form horizontal>
|
||||
<FormItem
|
||||
label="单独禁用输入框:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}>
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}>
|
||||
<Input defaultValue="我是禁用的" disabled />
|
||||
</FormItem>
|
||||
|
||||
@ -26,16 +26,16 @@ ReactDOM.render(
|
||||
<FormItem
|
||||
id="userName"
|
||||
label="用户名:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
required>
|
||||
<p className="ant-form-text">大眼萌 minion</p>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
id="password"
|
||||
label="密码:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
required>
|
||||
<Input type="password" defaultValue="123456" id="password" />
|
||||
</FormItem>
|
||||
|
@ -9,7 +9,7 @@
|
||||
---
|
||||
|
||||
````jsx
|
||||
import {Form, Input, Select, Checkbox, Radio} from 'antd';
|
||||
import { Form, Input, Select, Checkbox, Radio } from 'antd';
|
||||
const FormItem = Form.Item;
|
||||
const Option = Select.Option;
|
||||
const RadioGroup = Radio.Group;
|
||||
@ -23,25 +23,25 @@ ReactDOM.render(
|
||||
<FormItem
|
||||
id="control-input"
|
||||
label="输入框:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input id="control-input" placeholder="Please enter..." />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
id="control-textarea"
|
||||
label="文本域:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}>
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Input type="textarea" id="control-textarea" rows="3" />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
id="select"
|
||||
label="Select 选择器:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}>
|
||||
<Select id="select" size="large" defaultValue="lucy" style={{width: 200}} onChange={handleSelectChange}>
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}>
|
||||
<Select id="select" size="large" defaultValue="lucy" style={{ width: 200 }} onChange={handleSelectChange}>
|
||||
<Option value="jack">jack</Option>
|
||||
<Option value="lucy">lucy</Option>
|
||||
<Option value="disabled" disabled>disabled</Option>
|
||||
@ -51,8 +51,8 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="Checkbox 多选框:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 18}} >
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }} >
|
||||
<label className="ant-checkbox-vertical">
|
||||
<Checkbox />选项一
|
||||
</label>
|
||||
@ -66,8 +66,8 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="Checkbox 多选框:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 18}} >
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }} >
|
||||
<label className="ant-checkbox-inline">
|
||||
<Checkbox />选项一
|
||||
</label>
|
||||
@ -81,8 +81,8 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="Radio 单选框:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 18}} >
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }} >
|
||||
<RadioGroup value="b">
|
||||
<Radio value="a">A</Radio>
|
||||
<Radio value="b">B</Radio>
|
||||
|
@ -39,23 +39,23 @@ const Demo = React.createClass({
|
||||
<Form horizontal onSubmit={this.handleSubmit}>
|
||||
<FormItem
|
||||
label="用户名:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}
|
||||
required>
|
||||
<p className="ant-form-text" id="userName" name="userName">大眼萌 minion</p>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
id="password"
|
||||
label="密码:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}
|
||||
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}}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}
|
||||
required>
|
||||
<RadioGroup name="gender" value={formData.gender} onChange={this.setValue.bind(this, 'gender')} >
|
||||
<Radio value="male">男的</Radio>
|
||||
@ -65,14 +65,14 @@ const Demo = React.createClass({
|
||||
<FormItem
|
||||
id="remark"
|
||||
label="备注:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 14}}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}
|
||||
required
|
||||
help="随便写点什么">
|
||||
<Input type="textarea" placeholder="随便写" id="remark" name="remark" value={formData.remark} onChange={this.setValue.bind(this, 'remark')} />
|
||||
</FormItem>
|
||||
<FormItem
|
||||
wrapperCol={{span: 14, offset: 6}} >
|
||||
wrapperCol={{ span: 14, offset: 6 }} >
|
||||
<label>
|
||||
<Checkbox name="agreement" value={formData.agreement} onChange={this.setValue.bind(this, 'agreement')} />同意
|
||||
</label>
|
||||
|
@ -7,7 +7,7 @@
|
||||
---
|
||||
|
||||
````jsx
|
||||
import {Form, Input, Select, Row, Col} from 'antd';
|
||||
import { Form, Input, Select, Row, Col } from 'antd';
|
||||
const FormItem = Form.Item;
|
||||
const InputGroup = Input.Group;
|
||||
const Option = Select.Option;
|
||||
@ -16,26 +16,26 @@ ReactDOM.render(
|
||||
<Form horizontal>
|
||||
<FormItem
|
||||
label="标签输入框:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 16}}>
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<Input addonBefore="Http://" defaultValue="mysite.com" id="site1"/>
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label="标签输入框:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 16}}>
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<Input addonBefore="Http://" addonAfter=".com" defaultValue="mysite" id="site2"/>
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label="select 标签输入框:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 16}}>
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<InputGroup>
|
||||
<Input id="site4" placeholder="www.mysite" />
|
||||
<div className="ant-input-group-wrap">
|
||||
<Select defaultValue=".com" style={{width: 70}}>
|
||||
<Select defaultValue=".com" style={{ width: 70 }}>
|
||||
<Option value=".com">.com</Option>
|
||||
<Option value=".jp">.jp</Option>
|
||||
<Option value=".cn">.cn</Option>
|
||||
@ -47,8 +47,8 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="输入身份证:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 16}}>
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<InputGroup>
|
||||
<Col span="6">
|
||||
<Input id="certNo1" />
|
||||
@ -67,8 +67,8 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="电话号码:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 16}}>
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 16 }}>
|
||||
<Row>
|
||||
<Col span="4">
|
||||
<Input id="tel1" defaultValue="086" />
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
````jsx
|
||||
import {Row, Col, Input} from 'antd';
|
||||
import { Row, Col, Input } from 'antd';
|
||||
const InputGroup = Input.Group;
|
||||
|
||||
ReactDOM.render(
|
||||
|
@ -53,17 +53,17 @@ const Demo = React.createClass({
|
||||
<Form horizontal onSubmit={this.handleSubmit} >
|
||||
<FormItem
|
||||
label="InputNumber 数字输入框:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 10}}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 10 }}
|
||||
required>
|
||||
<InputNumber min={1} max={10} style={{width: 100}} defaultValue={3} name="inputNumber" onChange={this.setValue.bind(this, 'inputNumber')} value={formData.inputNumber} />
|
||||
<InputNumber 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>
|
||||
|
||||
<FormItem
|
||||
label="我是标题:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 10}}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 10 }}
|
||||
required>
|
||||
<p className="ant-form-text" id="static" name="static">唧唧复唧唧木兰当户织呀</p>
|
||||
<p className="ant-form-text">
|
||||
@ -73,26 +73,26 @@ const Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="Switch 开关:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 10}}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 10 }}
|
||||
required>
|
||||
<Switch name="switch" onChange={this.setValue.bind(this, 'switch')} value={formData.switch} />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label="Slider 滑动输入条:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 10}}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 10 }}
|
||||
required>
|
||||
<Slider marks={['A', 'B', 'C', 'D', 'E', 'F', 'G']} name="slider" onChange={this.setValue.bind(this, 'slider')} />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label="Select 选择器:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 16}}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
required>
|
||||
<Select defaultValue="lucy" style={{width: 200}} name="select" onChange={this.setValue.bind(this, 'select')} value={formData.select}>
|
||||
<Select 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>
|
||||
<Option value="disabled" disabled>disabled</Option>
|
||||
@ -102,7 +102,7 @@ const Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="DatePicker 日期选择框:"
|
||||
labelCol={{span: 8}}
|
||||
labelCol={{ span: 8 }}
|
||||
required>
|
||||
<Col span="6">
|
||||
<DatePicker name="startDate" onChange={this.setValue.bind(this, 'startDate')} value={formData.startDate} />
|
||||
@ -117,15 +117,15 @@ const Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="TimePicker 时间选择器:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 16}}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
required>
|
||||
<TimePicker />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label="选项:"
|
||||
labelCol={{span: 8}}>
|
||||
labelCol={{ span: 8 }}>
|
||||
<RadioGroup defaultValue="a">
|
||||
<RadioButton value="a">选项一</RadioButton>
|
||||
<RadioButton value="b">选项二</RadioButton>
|
||||
@ -135,8 +135,8 @@ const Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="logo图:"
|
||||
labelCol={{span: 8}}
|
||||
wrapperCol={{span: 16}}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
help="提示信息要长长长长长长长长长长长长长长">
|
||||
<Upload name="logo" action="/upload.do" listType="picture" onChange={this.handleUpload}>
|
||||
<Button type="ghost">
|
||||
@ -144,7 +144,7 @@ const Demo = React.createClass({
|
||||
</Button>
|
||||
</Upload>
|
||||
</FormItem>
|
||||
<Row style={{marginTop: 24}}>
|
||||
<Row style={{ marginTop: 24 }}>
|
||||
<Col span="16" offset="8">
|
||||
<Button type="primary" htmlType="submit">确定</Button>
|
||||
</Col>
|
||||
|
@ -58,6 +58,6 @@ const SearchInput = React.createClass({
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
<SearchInput placeholder="input search text" style={{width: 200}} />
|
||||
<SearchInput placeholder="input search text" style={{ width: 200 }} />
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -83,14 +83,14 @@ class BasicDemo extends React.Component {
|
||||
<Form horizontal form={this.props.form}>
|
||||
<FormItem
|
||||
label="用户名:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
hasFeedback
|
||||
id="name"
|
||||
fieldOption={{
|
||||
rules: [
|
||||
{required: true, min: 5, message: '用户名至少为 5 个字符'},
|
||||
{validator: this.userExists},
|
||||
{ required: true, min: 5, message: '用户名至少为 5 个字符' },
|
||||
{ validator: this.userExists },
|
||||
],
|
||||
}}
|
||||
help={isFieldValidating('name') ? '正在校验中..' : (getFieldError('name') || []).join(', ')}>
|
||||
@ -99,19 +99,19 @@ class BasicDemo extends React.Component {
|
||||
|
||||
<FormItem
|
||||
label="邮箱:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
hasFeedback
|
||||
id="email"
|
||||
fieldOption={{
|
||||
validate: [{
|
||||
rules: [
|
||||
{required: true},
|
||||
{ required: true },
|
||||
],
|
||||
trigger: 'onBlur',
|
||||
}, {
|
||||
rules: [
|
||||
{type: 'email', message: '请输入正确的邮箱地址'},
|
||||
{ type: 'email', message: '请输入正确的邮箱地址' },
|
||||
],
|
||||
trigger: ['onBlur', 'onChange'],
|
||||
}]
|
||||
@ -121,8 +121,8 @@ class BasicDemo extends React.Component {
|
||||
|
||||
<FormItem
|
||||
label="密码:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
hasFeedback
|
||||
id="passwd"
|
||||
fieldOption={{
|
||||
@ -137,8 +137,8 @@ class BasicDemo extends React.Component {
|
||||
|
||||
<FormItem
|
||||
label="确认密码:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
hasFeedback
|
||||
id="rePasswd"
|
||||
fieldOption={{
|
||||
@ -156,18 +156,18 @@ class BasicDemo extends React.Component {
|
||||
|
||||
<FormItem
|
||||
label="备注:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
id="textarea"
|
||||
fieldOption={{
|
||||
rules: [
|
||||
{required: true, message: '真的不打算写点什么吗?'},
|
||||
{ required: true, message: '真的不打算写点什么吗?' },
|
||||
],
|
||||
}}>
|
||||
<Input type="textarea" placeholder="随便写" id="textarea" name="textarea" />
|
||||
</FormItem>
|
||||
|
||||
<FormItem wrapperCol={{span: 12, offset: 7}} >
|
||||
<FormItem wrapperCol={{ span: 12, offset: 7 }} >
|
||||
<Button type="primary" onClick={this.handleSubmit.bind(this)}>确定</Button>
|
||||
|
||||
<Button type="ghost" onClick={this.handleReset.bind(this)}>重置</Button>
|
||||
|
@ -127,13 +127,13 @@ let Demo = React.createClass({
|
||||
<Col span="18">
|
||||
<FormItem
|
||||
label="密码:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 18}}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
id="pass"
|
||||
fieldOption={{
|
||||
rules: [
|
||||
{required: true, whitespace: true, message: '请填写密码'},
|
||||
{validator: this.checkPass}
|
||||
{ required: true, whitespace: true, message: '请填写密码' },
|
||||
{ validator: this.checkPass }
|
||||
]
|
||||
}}>
|
||||
<Input type="password"
|
||||
@ -150,8 +150,8 @@ let Demo = React.createClass({
|
||||
<Col span="18">
|
||||
<FormItem
|
||||
label="确认密码:"
|
||||
labelCol={{span: 6}}
|
||||
wrapperCol={{span: 18}}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
id="rePass"
|
||||
fieldOption={{
|
||||
rules: [{
|
||||
@ -175,7 +175,7 @@ let Demo = React.createClass({
|
||||
<Row>
|
||||
<Col span="18">
|
||||
<FormItem
|
||||
wrapperCol={{span: 12, offset: 6}}>
|
||||
wrapperCol={{ span: 12, offset: 6 }}>
|
||||
<Button type="primary" onClick={this.handleSubmit}>确定</Button>
|
||||
|
||||
<Button type="ghost" onClick={this.handleReset}>重置</Button>
|
||||
|
@ -62,15 +62,15 @@ let Demo = React.createClass({
|
||||
<Form horizontal form={this.props.form}>
|
||||
<FormItem
|
||||
label="国籍:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
id="select"
|
||||
fieldOption={{
|
||||
rules: [
|
||||
{ required: true, message: '请选择您的国籍' }
|
||||
],
|
||||
}}>
|
||||
<Select placeholder="请选择国家" style={{width: '100%'}}>
|
||||
<Select placeholder="请选择国家" style={{ width: '100%' }}>
|
||||
<Option value="china">中国</Option>
|
||||
<Option value="use">美国</Option>
|
||||
<Option value="japan">日本</Option>
|
||||
@ -81,15 +81,15 @@ let Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="喜欢的颜色:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
id="multiSelect"
|
||||
fieldOption={{
|
||||
rules: [
|
||||
{ required: true, message: '请选择您喜欢的颜色', type: 'array' },
|
||||
]
|
||||
}}>
|
||||
<Select multiple placeholder="请选择颜色" style={{width: '100%'}}>
|
||||
<Select multiple placeholder="请选择颜色" style={{ width: '100%' }}>
|
||||
<Option value="red">红色</Option>
|
||||
<Option value="orange">橙色</Option>
|
||||
<Option value="yellow">黄色</Option>
|
||||
@ -100,8 +100,8 @@ let Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="性别:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
id="radio"
|
||||
fieldOption={{
|
||||
rules: [
|
||||
@ -116,8 +116,8 @@ let Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="生日:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
id="birthday"
|
||||
fieldOption={{
|
||||
rules: [
|
||||
@ -135,8 +135,8 @@ let Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="8~12间的质数:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
id="primeNumber"
|
||||
fieldOption={{
|
||||
rules: [{ validator: this.checkPrime }],
|
||||
@ -146,8 +146,8 @@ let Demo = React.createClass({
|
||||
|
||||
<FormItem
|
||||
label="选择地址:"
|
||||
labelCol={{span: 7}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 7 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
id="address"
|
||||
fieldOption={{
|
||||
rules: [{ required: true, type: 'array' }],
|
||||
@ -156,7 +156,7 @@ let Demo = React.createClass({
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
wrapperCol={{span: 12, offset: 7}} >
|
||||
wrapperCol={{ span: 12, offset: 7 }} >
|
||||
<Button type="primary" onClick={this.handleSubmit}>确定</Button>
|
||||
|
||||
<Button type="ghost" onClick={this.handleReset}>重置</Button>
|
||||
|
@ -20,8 +20,8 @@ ReactDOM.render(
|
||||
<Form horizontal>
|
||||
<FormItem
|
||||
label="失败校验:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
validateStatus="error"
|
||||
help="请输入数字和字母组合">
|
||||
<Input defaultValue="无效选择" id="error" />
|
||||
@ -29,16 +29,16 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="警告校验:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
validateStatus="warning">
|
||||
<Input defaultValue="前方高能预警" id="warning" />
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label="校验中:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
hasFeedback
|
||||
validateStatus="validating"
|
||||
help="信息审核中...">
|
||||
@ -47,8 +47,8 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="成功校验:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
hasFeedback
|
||||
validateStatus="success">
|
||||
<Input defaultValue="我是正文" id="success" />
|
||||
@ -56,8 +56,8 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="警告校验:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
hasFeedback
|
||||
validateStatus="warning">
|
||||
<Input defaultValue="前方高能预警" id="warning" />
|
||||
@ -65,8 +65,8 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="失败校验:"
|
||||
labelCol={{span: 5}}
|
||||
wrapperCol={{span: 12}}
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 12 }}
|
||||
hasFeedback
|
||||
validateStatus="error"
|
||||
help="请输入数字和字母组合">
|
||||
@ -75,7 +75,7 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="Datepicker:"
|
||||
labelCol={{span: 5}}
|
||||
labelCol={{ span: 5 }}
|
||||
help>
|
||||
<Col span="6">
|
||||
<FormItem validateStatus="error" help="请选择正确日期">
|
||||
@ -94,7 +94,7 @@ ReactDOM.render(
|
||||
|
||||
<FormItem
|
||||
label="Datepicker:"
|
||||
labelCol={{span: 5}}
|
||||
labelCol={{ span: 5 }}
|
||||
validateStatus="error"
|
||||
help>
|
||||
<Col span="6">
|
||||
|
@ -24,7 +24,7 @@ const Test = React.createClass({
|
||||
return (
|
||||
<div>
|
||||
<InputNumber min={1} max={10} disabled={this.state.disabled} defaultValue={3} />
|
||||
<div style={{marginTop: 20}}>
|
||||
<div style={{ marginTop: 20 }}>
|
||||
<Button onClick={this.toggle} type="primary">Toggle disabled</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -32,7 +32,7 @@ const Sider = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<Menu onClick={this.handleClick}
|
||||
style={{width: 240}}
|
||||
style={{ width: 240 }}
|
||||
openKeys={this.state.openKeys}
|
||||
onOpen={this.onToggle}
|
||||
onClose={this.onToggle}
|
||||
|
@ -26,7 +26,7 @@ const Sider = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<Menu onClick={this.handleClick}
|
||||
style={{width: 240}}
|
||||
style={{ width: 240 }}
|
||||
defaultOpenKeys={['sub1']}
|
||||
selectedKeys={[this.state.current]}
|
||||
mode="inline">
|
||||
|
@ -35,7 +35,7 @@ const Sider = React.createClass({
|
||||
<br />
|
||||
<Menu theme={this.state.theme}
|
||||
onClick={this.handleClick}
|
||||
style={{width: 240}}
|
||||
style={{ width: 240 }}
|
||||
defaultOpenKeys={['sub1']}
|
||||
selectedKeys={[this.state.current]}
|
||||
mode="inline">
|
||||
|
@ -16,7 +16,7 @@ function handleClick(e) {
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<Menu onClick={handleClick} style={{width: 240}} mode="vertical">
|
||||
<Menu onClick={handleClick} style={{ width: 240 }} mode="vertical">
|
||||
<SubMenu key="sub1" title={<span><Icon type="mail" /><span>导航一</span></span>}>
|
||||
<MenuItemGroup title="分组1">
|
||||
<Menu.Item key="1">选项1</Menu.Item>
|
||||
|
@ -16,7 +16,7 @@ function confirm() {
|
||||
}
|
||||
|
||||
ReactDOM.render(<div>
|
||||
<div style={{marginLeft: 60}}>
|
||||
<div style={{ marginLeft: 60 }}>
|
||||
<Popconfirm placement="topLeft" title={text} onConfirm={confirm}>
|
||||
<Button>上左</Button>
|
||||
</Popconfirm>
|
||||
@ -27,7 +27,7 @@ ReactDOM.render(<div>
|
||||
<Button>上右</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
<div style={{width: 60, float: 'left'}}>
|
||||
<div style={{ width: 60, float: 'left' }}>
|
||||
<Popconfirm placement="leftTop" title={text} onConfirm={confirm}>
|
||||
<Button>左上</Button>
|
||||
</Popconfirm>
|
||||
@ -38,7 +38,7 @@ ReactDOM.render(<div>
|
||||
<Button>左下</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
<div style={{width: 60, marginLeft: 252}}>
|
||||
<div style={{ width: 60, marginLeft: 252 }}>
|
||||
<Popconfirm placement="rightTop" title={text} onConfirm={confirm}>
|
||||
<Button>右上</Button>
|
||||
</Popconfirm>
|
||||
@ -49,7 +49,7 @@ ReactDOM.render(<div>
|
||||
<Button>右下</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
<div style={{marginLeft: 60, clear: 'both'}}>
|
||||
<div style={{ marginLeft: 60, clear: 'both' }}>
|
||||
<Popconfirm placement="bottomLeft" title={text} onConfirm={confirm}>
|
||||
<Button>下左</Button>
|
||||
</Popconfirm>
|
||||
|
@ -19,7 +19,7 @@ const content = (
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<div style={{marginLeft: 60}}>
|
||||
<div style={{ marginLeft: 60 }}>
|
||||
<Popover placement="topLeft" title={text} overlay={content} trigger="click">
|
||||
<Button>上左</Button>
|
||||
</Popover>
|
||||
@ -30,7 +30,7 @@ ReactDOM.render(
|
||||
<Button>上右</Button>
|
||||
</Popover>
|
||||
</div>
|
||||
<div style={{width: 60, float: 'left'}}>
|
||||
<div style={{ width: 60, float: 'left' }}>
|
||||
<Popover placement="leftTop" title={text} overlay={content} trigger="click">
|
||||
<Button>左上</Button>
|
||||
</Popover>
|
||||
@ -41,7 +41,7 @@ ReactDOM.render(
|
||||
<Button>左下</Button>
|
||||
</Popover>
|
||||
</div>
|
||||
<div style={{width: 60, marginLeft: 270}}>
|
||||
<div style={{ width: 60, marginLeft: 270 }}>
|
||||
<Popover placement="rightTop" title={text} overlay={content} trigger="click">
|
||||
<Button>右上</Button>
|
||||
</Popover>
|
||||
@ -52,7 +52,7 @@ ReactDOM.render(
|
||||
<Button>右下</Button>
|
||||
</Popover>
|
||||
</div>
|
||||
<div style={{marginLeft: 60, clear: 'both'}}>
|
||||
<div style={{ marginLeft: 60, clear: 'both' }}>
|
||||
<Popover placement="bottomLeft" title={text} overlay={content} trigger="click">
|
||||
<Button>下左</Button>
|
||||
</Popover>
|
||||
|
@ -46,8 +46,8 @@ const Test = React.createClass({
|
||||
<div>
|
||||
<p className="buttons">
|
||||
<Button type="primary" onClick={this.onClick}>切换</Button>
|
||||
<Button onClick={this.onAdd} style={{marginLeft: 10}}>添加</Button>
|
||||
<Button onClick={this.onRemove} style={{marginLeft: 10}}>删除</Button>
|
||||
<Button onClick={this.onAdd} style={{ marginLeft: 10 }}>添加</Button>
|
||||
<Button onClick={this.onRemove} style={{ marginLeft: 10 }}>删除</Button>
|
||||
</p>
|
||||
<div className="demo-content">
|
||||
<div className="demo-listBox" key="b">
|
||||
|
@ -17,7 +17,7 @@ const App = React.createClass({
|
||||
const keys = key.replace('/', '') ? [key.replace('/', '')] : ['home'];
|
||||
return (
|
||||
<div>
|
||||
<Menu style={{marginBottom: 10}} mode="horizontal" selectedKeys={keys}>
|
||||
<Menu style={{ marginBottom: 10 }} mode="horizontal" selectedKeys={keys}>
|
||||
<Menu.Item key="home">
|
||||
<Link to="/">首页</Link>
|
||||
</Menu.Item>
|
||||
@ -29,7 +29,7 @@ const App = React.createClass({
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
<QueueAnim type={['right', 'left']} className="demo-router-wrap">
|
||||
{React.cloneElement(this.props.children || <Home/>, {key: key})}
|
||||
{React.cloneElement(this.props.children || <Home/>, { key: key })}
|
||||
</QueueAnim>
|
||||
</div>
|
||||
);
|
||||
@ -83,7 +83,7 @@ const Page1 = React.createClass({
|
||||
<div className="demo-listBox">
|
||||
<QueueAnim className="demo-list" delay={200}>
|
||||
<div className="title" key="title3"></div>
|
||||
<QueueAnim component="ul" animConfig={{opacity: [1, 0], translateY: [0, 30], scale: [1, 0.9]}} key="ul">
|
||||
<QueueAnim component="ul" animConfig={{ opacity: [1, 0], translateY: [0, 30], scale: [1, 0.9] }} key="ul">
|
||||
<li key="0"></li>
|
||||
<li key="1"></li>
|
||||
<li key="2"></li>
|
||||
@ -104,7 +104,7 @@ const Page2 = React.createClass({
|
||||
<div className="demo-listBox">
|
||||
<QueueAnim className="demo-list">
|
||||
<div className="title" key="title3"></div>
|
||||
<QueueAnim component="ul" animConfig={{opacity: [1, 0], translateY: [0, 30], scale: [1, 0.9]}} key="li">
|
||||
<QueueAnim component="ul" animConfig={{ opacity: [1, 0], translateY: [0, 30], scale: [1, 0.9] }} key="li">
|
||||
<li key="0"></li>
|
||||
<li key="1"></li>
|
||||
<li key="2"></li>
|
||||
|
@ -26,7 +26,7 @@ const App = React.createClass({
|
||||
<Radio defaultChecked={false} disabled={this.state.disabled}>不可用</Radio>
|
||||
<br />
|
||||
<Radio defaultChecked disabled={this.state.disabled}>不可用</Radio>
|
||||
<div style={{marginTop: 20}}>
|
||||
<div style={{ marginTop: 20 }}>
|
||||
<Button type="primary" onClick={this.toggleDisabled}>
|
||||
Toggle disabled
|
||||
</Button>
|
||||
|
@ -31,7 +31,7 @@ const App = React.createClass({
|
||||
<Radio value="c">C</Radio>
|
||||
<Radio value="d">D</Radio>
|
||||
</RadioGroup>
|
||||
<div style={{marginTop: 20}}>你选中的: {this.state.value}</div>
|
||||
<div style={{ marginTop: 20 }}>你选中的: {this.state.value}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -16,13 +16,13 @@ function handleChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Select defaultValue="lucy" style={{width: 120}} onChange={handleChange}>
|
||||
<Select defaultValue="lucy" style={{ width: 120 }} onChange={handleChange}>
|
||||
<Option value="jack">Jack</Option>
|
||||
<Option value="lucy">Lucy</Option>
|
||||
<Option value="disabled" disabled>Disabled</Option>
|
||||
<Option value="yiminghe">yiminghe</Option>
|
||||
</Select>
|
||||
<Select defaultValue="lucy" style={{width: 120}} disabled>
|
||||
<Select defaultValue="lucy" style={{ width: 120 }} disabled>
|
||||
<Option value="lucy">Lucy</Option>
|
||||
</Select>
|
||||
</div>
|
||||
|
@ -33,7 +33,7 @@ const Test = React.createClass({
|
||||
// filterOption 需要设置为 false,数据是动态设置的
|
||||
return (
|
||||
<Select combobox
|
||||
style={{width: 200}}
|
||||
style={{ width: 200 }}
|
||||
onChange={this.handleChange}
|
||||
filterOption={false}
|
||||
searchPlaceholder="请输入账户名">
|
||||
|
@ -42,10 +42,10 @@ const App = React.createClass({
|
||||
const cityOptions = this.state.cities.map(city => <Option key={city}>{city}</Option>);
|
||||
return (
|
||||
<div>
|
||||
<Select defaultValue={provinceData[0]} style={{width: 90}} onChange={this.handleProvinceChange}>
|
||||
<Select defaultValue={provinceData[0]} style={{ width: 90 }} onChange={this.handleProvinceChange}>
|
||||
{provinceOptions}
|
||||
</Select>
|
||||
<Select value={this.state.secondCity} style={{width: 90}} onChange={this.onSecondCityChange}>
|
||||
<Select value={this.state.secondCity} style={{ width: 90 }} onChange={this.onSecondCityChange}>
|
||||
{cityOptions}
|
||||
</Select>
|
||||
</div>
|
||||
|
@ -22,7 +22,7 @@ function handleChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Select multiple
|
||||
style={{width: 400}}
|
||||
style={{ width: 400 }}
|
||||
defaultValue={['a10', 'c12']} onChange={handleChange}>
|
||||
{children}
|
||||
</Select>
|
||||
|
@ -17,7 +17,7 @@ function handleChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Select defaultValue="lucy"
|
||||
style={{width: 200}}
|
||||
style={{ width: 200 }}
|
||||
showSearch={false}
|
||||
onChange={handleChange}>
|
||||
<OptGroup label="Manager">
|
||||
|
@ -15,7 +15,7 @@ function handleChange(value) {
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<Select defaultValue="lucy" showSearch style={{width: 200}}
|
||||
<Select defaultValue="lucy" showSearch style={{ width: 200 }}
|
||||
notFoundContent="找不到呐!"
|
||||
searchPlaceholder="输入"
|
||||
onChange={handleChange}>
|
||||
|
@ -16,19 +16,19 @@ function handleChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Select size="large" defaultValue="lucy" style={{width: 200}} onChange={handleChange}>
|
||||
<Select size="large" defaultValue="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>
|
||||
</Select>
|
||||
<Select defaultValue="lucy" style={{width: 200}} onChange={handleChange}>
|
||||
<Select defaultValue="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>
|
||||
</Select>
|
||||
<Select size="small" defaultValue="lucy" style={{width: 200}} onChange={handleChange}>
|
||||
<Select size="small" defaultValue="lucy" style={{ width: 200 }} onChange={handleChange}>
|
||||
<Option value="jack">Jack</Option>
|
||||
<Option value="lucy">Lucy</Option>
|
||||
<Option value="disabled" disabled>Disabled</Option>
|
||||
|
@ -22,7 +22,7 @@ function handleChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Select tags
|
||||
style={{width: '100%'}}
|
||||
style={{ width: '100%' }}
|
||||
searchPlaceholder="标签模式"
|
||||
onChange={handleChange}>
|
||||
{children}
|
||||
|
@ -27,7 +27,7 @@ const IntegerStep = React.createClass({
|
||||
<Slider min={1} max={20} onChange={this.onChange} value={this.state.inputValue} />
|
||||
</div>
|
||||
<div className="col-4">
|
||||
<InputNumber min={1} max={20} style={{marginLeft: '16px'}}
|
||||
<InputNumber min={1} max={20} style={{ marginLeft: '16px' }}
|
||||
value={this.state.inputValue} onChange={this.onChange} />
|
||||
</div>
|
||||
</div>
|
||||
@ -53,7 +53,7 @@ const DecimalStep = React.createClass({
|
||||
<Slider min={0} max={1} onChange={this.onChange} value={this.state.inputValue} step={0.01} />
|
||||
</div>
|
||||
<div className="col-4">
|
||||
<InputNumber min={0} max={1} style={{marginLeft: '16px'}} step={0.01}
|
||||
<InputNumber min={0} max={1} style={{ marginLeft: '16px' }} step={0.01}
|
||||
value={this.state.inputValue} onChange={this.onChange} />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -18,16 +18,16 @@ function expandedRowRender(record) {
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{title: '姓名', dataIndex: 'name', key: 'name'},
|
||||
{title: '年龄', dataIndex: 'age', key: 'age'},
|
||||
{title: '住址', dataIndex: 'address', key: 'address'},
|
||||
{title: '操作', dataIndex: '', key: 'x', render: renderAction}
|
||||
{ title: '姓名', dataIndex: 'name', key: 'name' },
|
||||
{ title: '年龄', dataIndex: 'age', key: 'age' },
|
||||
{ title: '住址', dataIndex: 'address', key: 'address' },
|
||||
{ title: '操作', dataIndex: '', key: 'x', render: renderAction }
|
||||
];
|
||||
|
||||
const data = [
|
||||
{key: 1, name: '胡彦斌', age: 32, address: '西湖区湖底公园1号', description: '我是胡彦斌,今年32岁,住在西湖区湖底公园1号。'},
|
||||
{key: 2, name: '吴彦祖', age: 42, address: '西湖区湖底公园2号', description: '我是吴彦祖,今年42岁,住在西湖区湖底公园2号。'},
|
||||
{key: 3, name: '李大嘴', age: 32, address: '西湖区湖底公园3号', description: '我是李大嘴,今年32岁,住在西湖区湖底公园3号。'}
|
||||
{ key: 1, name: '胡彦斌', age: 32, address: '西湖区湖底公园1号', description: '我是胡彦斌,今年32岁,住在西湖区湖底公园1号。' },
|
||||
{ key: 2, name: '吴彦祖', age: 42, address: '西湖区湖底公园2号', description: '我是吴彦祖,今年42岁,住在西湖区湖底公园2号。' },
|
||||
{ key: 3, name: '李大嘴', age: 32, address: '西湖区湖底公园3号', description: '我是李大嘴,今年32岁,住在西湖区湖底公园3号。' }
|
||||
];
|
||||
|
||||
ReactDOM.render(
|
||||
|
@ -62,10 +62,10 @@ const App = React.createClass({
|
||||
const hasSelected = selectedRowKeys.length > 0;
|
||||
return (
|
||||
<div>
|
||||
<div style={{marginBottom: 16}}>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<Button type="primary" onClick={this.start}
|
||||
disabled={!hasSelected} loading={loading}>操作</Button>
|
||||
<span style={{marginLeft: 8}}>{hasSelected ? `选择了 ${selectedRowKeys.length} 个对象` : ''}</span>
|
||||
<span style={{ marginLeft: 8 }}>{hasSelected ? `选择了 ${selectedRowKeys.length} 个对象` : ''}</span>
|
||||
</div>
|
||||
<Table rowSelection={rowSelection} columns={columns} dataSource={data} />
|
||||
</div>
|
||||
|
@ -23,7 +23,7 @@ const Demo = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<div style={{marginBottom: 16}}>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
页签位置:
|
||||
<Select value={this.state.tabPosition} onChange={this.changeTabPosition}
|
||||
dropdownMatchSelectWidth={false}>
|
||||
|
@ -16,8 +16,8 @@ const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
tags: [
|
||||
{ key: 1, name: '标签一'},
|
||||
{ key: 2, name: '标签二'},
|
||||
{ key: 1, name: '标签一' },
|
||||
{ key: 2, name: '标签二' },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
@ -12,7 +12,7 @@ const text = <span>提示文字</span>;
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<div style={{marginLeft: 60}}>
|
||||
<div style={{ marginLeft: 60 }}>
|
||||
<Tooltip placement="topLeft" title={text}>
|
||||
<a href="#">上左</a>
|
||||
</Tooltip>
|
||||
@ -23,7 +23,7 @@ ReactDOM.render(
|
||||
<a href="#">上右</a>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div style={{width: 60, float: 'left'}}>
|
||||
<div style={{ width: 60, float: 'left' }}>
|
||||
<Tooltip placement="leftTop" title={text}>
|
||||
<a href="#">左上</a>
|
||||
</Tooltip>
|
||||
@ -34,7 +34,7 @@ ReactDOM.render(
|
||||
<a href="#">左下</a>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div style={{width: 60, marginLeft: 270}}>
|
||||
<div style={{ width: 60, marginLeft: 270 }}>
|
||||
<Tooltip placement="rightTop" title={text}>
|
||||
<a href="#">右上</a>
|
||||
</Tooltip>
|
||||
@ -45,7 +45,7 @@ ReactDOM.render(
|
||||
<a href="#">右下</a>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div style={{marginLeft: 60, clear: 'both'}}>
|
||||
<div style={{ marginLeft: 60, clear: 'both' }}>
|
||||
<Tooltip placement="bottomLeft" title={text}>
|
||||
<a href="#">上右</a>
|
||||
</Tooltip>
|
||||
|
@ -21,9 +21,9 @@ const Demo = React.createClass({
|
||||
},
|
||||
render() {
|
||||
return (
|
||||
<TreeSelect style={{width: 180}} showSearch
|
||||
<TreeSelect style={{ width: 180 }} showSearch
|
||||
value={this.state.value} optionLabelProp="title"
|
||||
dropdownMenuStyle={{maxHeight: 200, overflow: 'auto'}}
|
||||
dropdownMenuStyle={{ maxHeight: 200, overflow: 'auto' }}
|
||||
treeDefaultExpandAll
|
||||
onChange={this.onChange}>
|
||||
<TreeNode value="parent 1" title="parent 1" key="0-1">
|
||||
|
@ -21,7 +21,7 @@ const generateData = (_level, _preKey, _tns) => {
|
||||
const children = [];
|
||||
for (let i = 0; i < x; i++) {
|
||||
const key = `${preKey}-${i}`;
|
||||
tns.push({title: key, key: key});
|
||||
tns.push({ title: key, key: key });
|
||||
if (i < y) {
|
||||
children.push(key);
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ const Demo = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<TreeSelect size="large" style={{width: 180}} showSearch
|
||||
<TreeSelect size="large" style={{ width: 180 }} showSearch
|
||||
value={this.state.value} optionLabelProp="title"
|
||||
dropdownMenuStyle={{maxHeight: 200, overflow: 'auto'}}
|
||||
dropdownMenuStyle={{ maxHeight: 200, overflow: 'auto' }}
|
||||
treeDefaultExpandAll
|
||||
onChange={this.onChange}>
|
||||
<TreeNode value="parent 1" title="parent 1" key="0-1">
|
||||
@ -38,9 +38,9 @@ const Demo = React.createClass({
|
||||
</TreeNode>
|
||||
</TreeSelect>
|
||||
<br /><br />
|
||||
<TreeSelect style={{width: 180}} showSearch
|
||||
<TreeSelect style={{ width: 180 }} showSearch
|
||||
value={this.state.value} optionLabelProp="title"
|
||||
dropdownMenuStyle={{maxHeight: 200, overflow: 'auto'}}
|
||||
dropdownMenuStyle={{ maxHeight: 200, overflow: 'auto' }}
|
||||
treeDefaultExpandAll
|
||||
onChange={this.onChange}>
|
||||
<TreeNode value="parent 1" title="parent 1" key="0-1">
|
||||
@ -54,9 +54,9 @@ const Demo = React.createClass({
|
||||
</TreeNode>
|
||||
</TreeSelect>
|
||||
<br /><br />
|
||||
<TreeSelect size="small" style={{width: 180}} showSearch
|
||||
<TreeSelect size="small" style={{ width: 180 }} showSearch
|
||||
value={this.state.value} optionLabelProp="title"
|
||||
dropdownMenuStyle={{maxHeight: 200, overflow: 'auto'}}
|
||||
dropdownMenuStyle={{ maxHeight: 200, overflow: 'auto' }}
|
||||
treeDefaultExpandAll
|
||||
onChange={this.onChange}>
|
||||
<TreeNode value="parent 1" title="parent 1" key="0-1">
|
||||
|
@ -9,7 +9,7 @@
|
||||
````jsx
|
||||
import { Tree } from 'antd';
|
||||
const TreeNode = Tree.TreeNode;
|
||||
import React, {PropTypes} from 'react';
|
||||
import React, { PropTypes } from 'react';
|
||||
|
||||
const x = 3;
|
||||
const y = 2;
|
||||
@ -23,7 +23,7 @@ const generateData = (_level, _preKey, _tns) => {
|
||||
const children = [];
|
||||
for (let i = 0; i < x; i++) {
|
||||
const key = `${preKey}-${i}`;
|
||||
tns.push({title: key, key: key});
|
||||
tns.push({ title: key, key: key });
|
||||
if (i < y) {
|
||||
children.push(key);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
````jsx
|
||||
import { Tree } from 'antd';
|
||||
const TreeNode = Tree.TreeNode;
|
||||
import React, {PropTypes} from 'react';
|
||||
import React, { PropTypes } from 'react';
|
||||
|
||||
const Demo = React.createClass({
|
||||
propTypes: {
|
||||
@ -48,7 +48,7 @@ const Demo = React.createClass({
|
||||
});
|
||||
},
|
||||
render() {
|
||||
return (<div style={{margin: '0 20px'}}>
|
||||
return (<div style={{ margin: '0 20px' }}>
|
||||
<h2>simple</h2>
|
||||
<Tree className="myCls" showLine multiple checkable
|
||||
defaultExpandedKeys={this.state.defaultExpandedKeys}
|
||||
@ -62,7 +62,7 @@ const Demo = React.createClass({
|
||||
<TreeNode title="leaf" key="0-0-0-1" />
|
||||
</TreeNode>
|
||||
<TreeNode title="parent 1-1" key="0-0-1">
|
||||
<TreeNode title={<span style={{color: 'red'}}>sss</span>} key="0-0-1-0" />
|
||||
<TreeNode title={<span style={{ color: 'red' }}>sss</span>} key="0-0-1-0" />
|
||||
</TreeNode>
|
||||
</TreeNode>
|
||||
</Tree>
|
||||
|
@ -23,7 +23,7 @@ const generateData = (_level, _preKey, _tns) => {
|
||||
const children = [];
|
||||
for (let i = 0; i < x; i++) {
|
||||
const key = `${preKey}-${i}`;
|
||||
tns.push({title: key, key: key});
|
||||
tns.push({ title: key, key: key });
|
||||
if (i < y) {
|
||||
children.push(key);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ function generateTreeNodes(treeNode) {
|
||||
const arr = [];
|
||||
const key = treeNode.props.eventKey;
|
||||
for (let i = 0; i < 3; i++) {
|
||||
arr.push({name: `leaf ${key}-${i}`, key: `${key}-${i}`});
|
||||
arr.push({ name: `leaf ${key}-${i}`, key: `${key}-${i}` });
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
@ -66,9 +66,9 @@ const Demo = React.createClass({
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
treeData: [
|
||||
{name: 'pNode 01', key: '0-0'},
|
||||
{name: 'pNode 02', key: '0-1'},
|
||||
{name: 'pNode 03', key: '0-2', isLeaf: true},
|
||||
{ name: 'pNode 01', key: '0-0' },
|
||||
{ name: 'pNode 02', key: '0-1' },
|
||||
{ name: 'pNode 03', key: '0-2', isLeaf: true },
|
||||
],
|
||||
});
|
||||
}, 100);
|
||||
@ -81,7 +81,7 @@ const Demo = React.createClass({
|
||||
setTimeout(() => {
|
||||
const treeData = [...this.state.treeData];
|
||||
getNewTreeData(treeData, treeNode.props.eventKey, generateTreeNodes(treeNode), 2);
|
||||
this.setState({treeData});
|
||||
this.setState({ treeData });
|
||||
resolve();
|
||||
}, 500);
|
||||
});
|
||||
|
@ -91,7 +91,7 @@ export default React.createClass({
|
||||
this.props.listType === 'picture-card' && file.status !== 'uploading'
|
||||
? (
|
||||
<span>
|
||||
<a href={file.url} target="_blank" style={{ pointerEvents: file.url ? '' : 'none'}}><Icon type="eye-o" /></a>
|
||||
<a href={file.url} target="_blank" style={{ pointerEvents: file.url ? '' : 'none' }}><Icon type="eye-o" /></a>
|
||||
<Icon type="delete" onClick={this.handleClose.bind(this, file)} />
|
||||
</span>
|
||||
) : <Icon type="cross" onClick={this.handleClose.bind(this, file)} />
|
||||
|
Loading…
Reference in New Issue
Block a user