mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
style: enable comma-dangle
This commit is contained in:
parent
5077873ae0
commit
ecaa6c56c3
@ -23,7 +23,6 @@ const eslintrc = {
|
||||
'babel',
|
||||
],
|
||||
rules: {
|
||||
'comma-dangle': 0,
|
||||
'func-names': 0,
|
||||
'prefer-const': 0,
|
||||
'arrow-body-style': 0,
|
||||
|
@ -15,7 +15,7 @@ export default class Alert extends React.Component {
|
||||
super(props);
|
||||
this.state = {
|
||||
closing: true,
|
||||
closed: false
|
||||
closed: false,
|
||||
};
|
||||
}
|
||||
handleClose = (e) => {
|
||||
@ -27,19 +27,19 @@ export default class Alert extends React.Component {
|
||||
dom.style.height = `${dom.offsetHeight}px`;
|
||||
|
||||
this.setState({
|
||||
closing: false
|
||||
closing: false,
|
||||
});
|
||||
this.props.onClose.call(this, e);
|
||||
}
|
||||
animationEnd = () => {
|
||||
this.setState({
|
||||
closed: true,
|
||||
closing: true
|
||||
closing: true,
|
||||
});
|
||||
}
|
||||
render() {
|
||||
let {
|
||||
closable, description, type, prefixCls, message, closeText, showIcon
|
||||
closable, description, type, prefixCls, message, closeText, showIcon,
|
||||
} = this.props;
|
||||
|
||||
let iconType = '';
|
||||
|
@ -22,7 +22,7 @@ export default class ScrollNumber extends React.Component {
|
||||
static propTypes = {
|
||||
count: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number
|
||||
React.PropTypes.number,
|
||||
]),
|
||||
component: React.PropTypes.string,
|
||||
onAnimated: React.PropTypes.func,
|
||||
@ -33,7 +33,7 @@ export default class ScrollNumber extends React.Component {
|
||||
super(props);
|
||||
this.state = {
|
||||
animateStarted: true,
|
||||
count: props.count
|
||||
count: props.count,
|
||||
};
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ export default class ScrollNumber extends React.Component {
|
||||
render() {
|
||||
const props = {
|
||||
...this.props,
|
||||
className: `${this.props.prefixCls} ${this.props.className}`
|
||||
className: `${this.props.prefixCls} ${this.props.className}`,
|
||||
};
|
||||
return createElement(
|
||||
this.props.component,
|
||||
|
@ -56,7 +56,7 @@ const Test = React.createClass({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
|
@ -14,7 +14,7 @@ export default class Badge extends React.Component {
|
||||
static propTypes = {
|
||||
count: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number
|
||||
React.PropTypes.number,
|
||||
]),
|
||||
dot: React.PropTypes.bool,
|
||||
overflowCount: React.PropTypes.number,
|
||||
|
@ -36,7 +36,7 @@ function Home(props) {
|
||||
marginBottom: 15,
|
||||
marginTop: 15,
|
||||
paddingBottom: 15,
|
||||
borderBottom: '1px dashed #ccc'
|
||||
borderBottom: '1px dashed #ccc',
|
||||
}}>
|
||||
点击上面的导航切换页面,面包屑在下面:
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@ export default function ButtonGroup(props) {
|
||||
const classes = classNames({
|
||||
'ant-btn-group': true,
|
||||
[prefix + sizeCls]: sizeCls,
|
||||
[className]: className
|
||||
[className]: className,
|
||||
});
|
||||
|
||||
return <div {...others} className={classes} />;
|
||||
|
@ -42,7 +42,7 @@ const App = React.createClass({
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -14,13 +14,13 @@ function getListData(value) {
|
||||
case 8:
|
||||
listData = [
|
||||
{ type: 'warning', content: '这里是警告事项.' },
|
||||
{ type: 'normal', content: '这里是普通事项.' }
|
||||
{ type: 'normal', content: '这里是普通事项.' },
|
||||
]; break;
|
||||
case 10:
|
||||
listData = [
|
||||
{ type: 'warning', content: '这里是警告事项.' },
|
||||
{ type: 'normal', content: '这里是普通事项.' },
|
||||
{ type: 'error', content: '这里是错误事项.' }
|
||||
{ type: 'error', content: '这里是错误事项.' },
|
||||
]; break;
|
||||
case 15:
|
||||
listData = [
|
||||
@ -29,7 +29,7 @@ function getListData(value) {
|
||||
{ type: 'error', content: '这里是错误事项.' },
|
||||
{ type: 'error', content: '这里是错误事项.' },
|
||||
{ type: 'error', content: '这里是错误事项.' },
|
||||
{ type: 'error', content: '这里是错误事项.' }
|
||||
{ type: 'error', content: '这里是错误事项.' },
|
||||
]; break;
|
||||
default:
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ export default class Calendar extends React.Component {
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if ('value' in nextProps) {
|
||||
this.setState({
|
||||
value: this.parseDateFromValue(nextProps.value)
|
||||
value: this.parseDateFromValue(nextProps.value),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
checked: true,
|
||||
disabled: false
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
render() {
|
||||
@ -51,7 +51,7 @@ const App = React.createClass({
|
||||
this.setState({
|
||||
checked: e.target.checked,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -6,7 +6,7 @@ import classNames from 'classnames';
|
||||
export default class Checkbox extends React.Component {
|
||||
static Group = CheckboxGroup;
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-checkbox'
|
||||
prefixCls: 'ant-checkbox',
|
||||
}
|
||||
render() {
|
||||
const { prefixCls, style, children, className, ...restProps } = this.props;
|
||||
|
@ -17,8 +17,8 @@ export default class RangePicker extends React.Component {
|
||||
this.state = {
|
||||
value: [
|
||||
parseDateFromValue(start),
|
||||
parseDateFromValue(end)
|
||||
]
|
||||
parseDateFromValue(end),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ export default class RangePicker extends React.Component {
|
||||
const start = nextProps.parseDateFromValue(value[0]);
|
||||
const end = nextProps.parseDateFromValue(value[1]);
|
||||
this.setState({
|
||||
value: [start, end]
|
||||
value: [start, end],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ export default function createPicker(TheCalendar) {
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if ('value' in nextProps) {
|
||||
this.setState({
|
||||
value: nextProps.parseDateFromValue(nextProps.value)
|
||||
value: nextProps.parseDateFromValue(nextProps.value),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ const DateRange = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
startValue: null,
|
||||
endValue: null
|
||||
endValue: null,
|
||||
};
|
||||
},
|
||||
disabledStartDate(startValue) {
|
||||
@ -52,7 +52,7 @@ const DateRange = React.createClass({
|
||||
onChange={this.onEndChange} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
|
@ -48,7 +48,7 @@ const DateTimePicker = React.createClass({
|
||||
<TimePicker onChange={this.handleTimeChange} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function onSelect(value) {
|
||||
|
@ -17,7 +17,7 @@ export default function wrapPicker(Picker, defaultFormat) {
|
||||
align: {
|
||||
offset: [0, -9],
|
||||
},
|
||||
open: false
|
||||
open: false,
|
||||
}
|
||||
|
||||
static contextTypes = {
|
||||
@ -67,7 +67,7 @@ export default function wrapPicker(Picker, defaultFormat) {
|
||||
|
||||
toggleOpen = (e) => {
|
||||
this.setState({
|
||||
open: e.open
|
||||
open: e.open,
|
||||
});
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ export default function wrapPicker(Picker, defaultFormat) {
|
||||
const state = this.state;
|
||||
const pickerClass = classNames({
|
||||
'ant-calendar-picker': true,
|
||||
'ant-calendar-picker-open': state.open
|
||||
'ant-calendar-picker-open': state.open,
|
||||
});
|
||||
const pickerInputClass = classNames({
|
||||
'ant-calendar-range-picker': true,
|
||||
@ -91,7 +91,7 @@ export default function wrapPicker(Picker, defaultFormat) {
|
||||
const rcTimePickerProps = {
|
||||
formatter: new DateTimeFormat(timeFormat || 'HH:mm:ss'),
|
||||
showSecond: timeFormat && timeFormat.indexOf('ss') >= 0,
|
||||
showHour: timeFormat && timeFormat.indexOf('HH') >= 0
|
||||
showHour: timeFormat && timeFormat.indexOf('HH') >= 0,
|
||||
};
|
||||
const timePicker = props.showTime ? (
|
||||
<TimePicker
|
||||
|
@ -11,7 +11,7 @@ import { Menu, Dropdown, Icon } from 'antd';
|
||||
const OverlayVisible = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
visible: false
|
||||
visible: false,
|
||||
};
|
||||
},
|
||||
handleMenuClick(e) {
|
||||
@ -39,7 +39,7 @@ const OverlayVisible = React.createClass({
|
||||
</a>
|
||||
</Dropdown>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<OverlayVisible />, mountNode);
|
||||
|
@ -54,7 +54,7 @@ let Demo = React.createClass({
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Demo = createForm()(Demo);
|
||||
|
@ -58,7 +58,7 @@ let Demo = React.createClass({
|
||||
</FormItem>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Demo = Form.create()(Demo);
|
||||
|
@ -35,7 +35,7 @@ let Demo = React.createClass({
|
||||
<Button type="primary" htmlType="submit">登录</Button>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Demo = Form.create()(Demo);
|
||||
|
@ -142,7 +142,7 @@ let Demo = React.createClass({
|
||||
<Upload name="logo" action="/upload.do" listType="picture" onChange={this.handleUpload}
|
||||
{...getFieldProps('upload', {
|
||||
valuePropName: 'fileList',
|
||||
normalize: this.normFile
|
||||
normalize: this.normFile,
|
||||
})}
|
||||
>
|
||||
<Button type="ghost">
|
||||
@ -156,7 +156,7 @@ let Demo = React.createClass({
|
||||
</FormItem>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Demo = Form.create()(Demo);
|
||||
|
@ -52,7 +52,7 @@ const SearchInput = React.createClass({
|
||||
</div>
|
||||
</InputGroup>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
|
@ -82,7 +82,7 @@ let BasicDemo = React.createClass({
|
||||
{ type: 'email', message: '请输入正确的邮箱地址' },
|
||||
],
|
||||
trigger: ['onBlur', 'onChange'],
|
||||
}]
|
||||
}],
|
||||
});
|
||||
const passwdProps = getFieldProps('passwd', {
|
||||
rules: [
|
||||
|
@ -91,12 +91,12 @@ let Demo = React.createClass({
|
||||
'ant-pwd-strength': true,
|
||||
'ant-pwd-strength-low': strength === 'L',
|
||||
'ant-pwd-strength-medium': strength === 'M',
|
||||
'ant-pwd-strength-high': strength === 'H'
|
||||
'ant-pwd-strength-high': strength === 'H',
|
||||
});
|
||||
const level = {
|
||||
L: '低',
|
||||
M: '中',
|
||||
H: '高'
|
||||
H: '高',
|
||||
};
|
||||
|
||||
return (
|
||||
@ -119,7 +119,7 @@ let Demo = React.createClass({
|
||||
const passProps = getFieldProps('pass', {
|
||||
rules: [
|
||||
{ required: true, whitespace: true, message: '请填写密码' },
|
||||
{ validator: this.checkPass }
|
||||
{ validator: this.checkPass },
|
||||
],
|
||||
onChange: (e) => {
|
||||
console.log('你的密码就是这样被盗的:', e.target.value);
|
||||
@ -182,7 +182,7 @@ let Demo = React.createClass({
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Demo = createForm()(Demo);
|
||||
|
@ -66,18 +66,18 @@ let Demo = React.createClass({
|
||||
const { getFieldProps } = this.props.form;
|
||||
const selectProps = getFieldProps('select', {
|
||||
rules: [
|
||||
{ required: true, message: '请选择您的国籍' }
|
||||
{ required: true, message: '请选择您的国籍' },
|
||||
],
|
||||
});
|
||||
const multiSelectProps = getFieldProps('multiSelect', {
|
||||
rules: [
|
||||
{ required: true, message: '请选择您喜欢的颜色', type: 'array' },
|
||||
]
|
||||
],
|
||||
});
|
||||
const radioProps = getFieldProps('radio', {
|
||||
rules: [
|
||||
{ required: true, message: '请选择您的性别' }
|
||||
]
|
||||
{ required: true, message: '请选择您的性别' },
|
||||
],
|
||||
});
|
||||
const birthdayProps = getFieldProps('birthday', {
|
||||
rules: [
|
||||
@ -87,8 +87,8 @@ let Demo = React.createClass({
|
||||
message: '你的生日是什么呢?',
|
||||
}, {
|
||||
validator: this.checkBirthday,
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
});
|
||||
const primeNumberProps = getFieldProps('primeNumber', {
|
||||
rules: [{ validator: this.checkPrime }],
|
||||
|
@ -11,12 +11,12 @@ import { InputNumber, Button } from 'antd';
|
||||
const Test = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
};
|
||||
},
|
||||
toggle() {
|
||||
this.setState({
|
||||
disabled: !this.state.disabled
|
||||
disabled: !this.state.disabled,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -28,7 +28,7 @@ const Test = React.createClass({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -34,7 +34,7 @@ export default class Row extends React.Component {
|
||||
style: gutter > 0 ? {
|
||||
paddingLeft: gutter / 2,
|
||||
paddingRight: gutter / 2,
|
||||
...col.props.style
|
||||
...col.props.style,
|
||||
} : col.props.style,
|
||||
});
|
||||
});
|
||||
|
@ -91,7 +91,7 @@ const Page = React.createClass({
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const App = React.createClass({
|
||||
@ -117,7 +117,7 @@ const App = React.createClass({
|
||||
<LocaleProvider locale={this.state.locale}><Page /></LocaleProvider>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -48,7 +48,7 @@ const App = React.createClass({
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -13,19 +13,19 @@ const Sider = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
current: '1',
|
||||
openKeys: []
|
||||
openKeys: [],
|
||||
};
|
||||
},
|
||||
handleClick(e) {
|
||||
console.log('click ', e);
|
||||
this.setState({
|
||||
current: e.key,
|
||||
openKeys: e.keyPath.slice(1)
|
||||
openKeys: e.keyPath.slice(1),
|
||||
});
|
||||
},
|
||||
onToggle(info) {
|
||||
this.setState({
|
||||
openKeys: info.open ? info.keyPath : info.keyPath.slice(1)
|
||||
openKeys: info.open ? info.keyPath : info.keyPath.slice(1),
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -59,7 +59,7 @@ const Sider = React.createClass({
|
||||
</SubMenu>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
ReactDOM.render(<Sider />, mountNode);
|
||||
````
|
||||
|
@ -13,13 +13,13 @@ const MenuItemGroup = Menu.ItemGroup;
|
||||
const Sider = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
current: '1'
|
||||
current: '1',
|
||||
};
|
||||
},
|
||||
handleClick(e) {
|
||||
console.log('click ', e);
|
||||
this.setState({
|
||||
current: e.key
|
||||
current: e.key,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -55,7 +55,7 @@ const Sider = React.createClass({
|
||||
</SubMenu>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
ReactDOM.render(<Sider />, mountNode);
|
||||
````
|
||||
|
@ -58,7 +58,7 @@ const Sider = React.createClass({
|
||||
</Menu>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
ReactDOM.render(<Sider />, mountNode);
|
||||
````
|
||||
|
@ -12,18 +12,18 @@ const SubMenu = Menu.SubMenu;
|
||||
const Sider = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
theme: 'light'
|
||||
theme: 'light',
|
||||
};
|
||||
},
|
||||
changeTheme(value) {
|
||||
this.setState({
|
||||
theme: value ? 'dark' : 'light'
|
||||
theme: value ? 'dark' : 'light',
|
||||
});
|
||||
},
|
||||
handleClick(e) {
|
||||
console.log('click ', e);
|
||||
this.setState({
|
||||
current: e.key
|
||||
current: e.key,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -61,7 +61,7 @@ const Sider = React.createClass({
|
||||
</Menu>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
ReactDOM.render(<Sider />, mountNode);
|
||||
````
|
||||
|
@ -24,7 +24,7 @@ function notice(content, duration = defaultDuration, type, onClose) {
|
||||
success: 'check-circle',
|
||||
error: 'cross-circle',
|
||||
warning: 'exclamation-circle',
|
||||
loading: 'loading'
|
||||
loading: 'loading',
|
||||
})[type];
|
||||
|
||||
let instance = getMessageInstance();
|
||||
|
@ -55,7 +55,7 @@ export default class Modal extends React.Component {
|
||||
Dom.addEventListener(document.documentElement, 'click', (e) => {
|
||||
mousePosition = {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
y: e.pageY,
|
||||
};
|
||||
// 20ms 内发生过点击事件,则从点击位置动画展示
|
||||
// 否则直接 zoom 展示
|
||||
@ -87,7 +87,7 @@ export default class Modal extends React.Component {
|
||||
loading={props.confirmLoading}
|
||||
onClick={this.handleOk}>
|
||||
{okText || '确定'}
|
||||
</Button>
|
||||
</Button>,
|
||||
];
|
||||
let footer = props.footer || defaultFooter;
|
||||
return (
|
||||
|
@ -12,30 +12,30 @@ const Test = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
ModalText: '对话框的内容',
|
||||
visible: false
|
||||
visible: false,
|
||||
};
|
||||
},
|
||||
showModal() {
|
||||
this.setState({
|
||||
visible: true
|
||||
visible: true,
|
||||
});
|
||||
},
|
||||
handleOk() {
|
||||
this.setState({
|
||||
ModalText: '对话框将在两秒后关闭',
|
||||
confirmLoading: true
|
||||
confirmLoading: true,
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
visible: false,
|
||||
confirmLoading: false
|
||||
confirmLoading: false,
|
||||
});
|
||||
}, 2000);
|
||||
},
|
||||
handleCancel() {
|
||||
console.log('点击了取消');
|
||||
this.setState({
|
||||
visible: false
|
||||
visible: false,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -51,7 +51,7 @@ const Test = React.createClass({
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -14,19 +14,19 @@ const App = React.createClass({
|
||||
},
|
||||
showModal() {
|
||||
this.setState({
|
||||
visible: true
|
||||
visible: true,
|
||||
});
|
||||
},
|
||||
handleOk() {
|
||||
console.log('点击了确定');
|
||||
this.setState({
|
||||
visible: false
|
||||
visible: false,
|
||||
});
|
||||
},
|
||||
handleCancel(e) {
|
||||
console.log(e);
|
||||
this.setState({
|
||||
visible: false
|
||||
visible: false,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -41,7 +41,7 @@ const App = React.createClass({
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -18,7 +18,7 @@ function showConfirm() {
|
||||
setTimeout(resolve, 1000);
|
||||
});
|
||||
},
|
||||
onCancel() {}
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ function showConfirm() {
|
||||
onOk() {
|
||||
console.log('确定');
|
||||
},
|
||||
onCancel() {}
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -12,12 +12,12 @@ const Test = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
loading: false,
|
||||
visible: false
|
||||
visible: false,
|
||||
};
|
||||
},
|
||||
showModal() {
|
||||
this.setState({
|
||||
visible: true
|
||||
visible: true,
|
||||
});
|
||||
},
|
||||
handleOk() {
|
||||
@ -42,7 +42,7 @@ const Test = React.createClass({
|
||||
<Button key="back" type="ghost" size="large" onClick={this.handleCancel}>返 回</Button>,
|
||||
<Button key="submit" type="primary" size="large" loading={this.state.loading} onClick={this.handleOk}>
|
||||
提 交
|
||||
</Button>
|
||||
</Button>,
|
||||
]}>
|
||||
<p>对话框的内容</p>
|
||||
<p>对话框的内容</p>
|
||||
@ -52,7 +52,7 @@ const Test = React.createClass({
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -14,17 +14,17 @@ const LocalizedModal = React.createClass({
|
||||
},
|
||||
showModal() {
|
||||
this.setState({
|
||||
visible: true
|
||||
visible: true,
|
||||
});
|
||||
},
|
||||
handleOk() {
|
||||
this.setState({
|
||||
visible: false
|
||||
visible: false,
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.setState({
|
||||
visible: false
|
||||
visible: false,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -40,7 +40,7 @@ const LocalizedModal = React.createClass({
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function confirm() {
|
||||
@ -48,7 +48,7 @@ function confirm() {
|
||||
title: 'Confirm',
|
||||
content: 'Bla bla ...',
|
||||
okText: 'OK',
|
||||
cancelText: 'Cancel'
|
||||
cancelText: 'Cancel',
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ import { Button, notification } from 'antd';
|
||||
const openNotification = function () {
|
||||
notification.open({
|
||||
message: '这是标题',
|
||||
description: '这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案'
|
||||
description: '这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案',
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -12,7 +12,7 @@ const openNotification = function () {
|
||||
const args = {
|
||||
message: '这是标题',
|
||||
description: '我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭',
|
||||
duration: 0
|
||||
duration: 0,
|
||||
};
|
||||
notification.open(args);
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ const openNotification = function () {
|
||||
description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案',
|
||||
btn,
|
||||
key,
|
||||
onClose: close
|
||||
onClose: close,
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -12,7 +12,7 @@ const openNotificationWithIcon = function (type) {
|
||||
return function () {
|
||||
notification[type]({
|
||||
message: '这是标题',
|
||||
description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案'
|
||||
description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案',
|
||||
});
|
||||
};
|
||||
};
|
||||
|
@ -16,7 +16,7 @@ function getNotificationInstance() {
|
||||
style: {
|
||||
top: defaultTop,
|
||||
right: 0,
|
||||
}
|
||||
},
|
||||
});
|
||||
return notificationInstance;
|
||||
}
|
||||
|
@ -11,18 +11,18 @@ import { Pagination } from 'antd';
|
||||
const Container = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
current: 3
|
||||
current: 3,
|
||||
};
|
||||
},
|
||||
onChange(page) {
|
||||
console.log(page);
|
||||
this.setState({
|
||||
current: page
|
||||
current: page,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
return <Pagination current={this.state.current} onChange={this.onChange} total={50} />;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Container />, mountNode);
|
||||
|
@ -52,7 +52,7 @@ let App = React.createClass({
|
||||
点击是否直接执行:<Switch defaultChecked onChange={this.changeCondition} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -26,7 +26,7 @@ export default class Popconfirm extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
visible: false
|
||||
visible: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,12 @@ import { Popover, Button } from 'antd';
|
||||
const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
visible: false
|
||||
visible: false,
|
||||
};
|
||||
},
|
||||
hide() {
|
||||
this.setState({
|
||||
visible: false
|
||||
visible: false,
|
||||
});
|
||||
},
|
||||
handleVisibleChange(visible) {
|
||||
@ -34,7 +34,7 @@ const App = React.createClass({
|
||||
<Button type="primary">点击弹出卡片</Button>
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -12,7 +12,7 @@ const ButtonGroup = Button.Group;
|
||||
const MyProgress = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
percent: 0
|
||||
percent: 0,
|
||||
};
|
||||
},
|
||||
increase() {
|
||||
@ -39,7 +39,7 @@ const MyProgress = React.createClass({
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<MyProgress />, mountNode);
|
||||
|
@ -12,7 +12,7 @@ const ButtonGroup = Button.Group;
|
||||
const MyProgress = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
percent: 0
|
||||
percent: 0,
|
||||
};
|
||||
},
|
||||
increase() {
|
||||
@ -39,7 +39,7 @@ const MyProgress = React.createClass({
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<MyProgress />, mountNode);
|
||||
|
@ -6,7 +6,7 @@ import classNames from 'classnames';
|
||||
const statusColorMap = {
|
||||
normal: '#2db7f5',
|
||||
exception: '#ff5500',
|
||||
success: '#87d068'
|
||||
success: '#87d068',
|
||||
};
|
||||
|
||||
export default class Line extends React.Component {
|
||||
|
@ -11,12 +11,12 @@ import { QueueAnim, Button } from 'antd';
|
||||
const Test = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
show: true
|
||||
show: true,
|
||||
};
|
||||
},
|
||||
onClick() {
|
||||
this.setState({
|
||||
show: !this.state.show
|
||||
show: !this.state.show,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -37,7 +37,7 @@ const Test = React.createClass({
|
||||
<li></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>,
|
||||
] : null;
|
||||
return (
|
||||
<div>
|
||||
@ -49,7 +49,7 @@ const Test = React.createClass({
|
||||
</QueueAnim>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -15,7 +15,7 @@ const Test = React.createClass({
|
||||
items: [
|
||||
<li key="0"></li>,
|
||||
<li key="1"></li>,
|
||||
<li key="2"></li>
|
||||
<li key="2"></li>,
|
||||
],
|
||||
};
|
||||
},
|
||||
@ -60,7 +60,7 @@ const Test = React.createClass({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -37,7 +37,7 @@ const Test = React.createClass({
|
||||
<li></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>,
|
||||
] : null;
|
||||
return (
|
||||
<div>
|
||||
@ -47,13 +47,13 @@ const Test = React.createClass({
|
||||
<QueueAnim className="demo-content"
|
||||
animConfig={[
|
||||
{ opacity: [1, 0], translateY: [0, 50] },
|
||||
{ opacity: [1, 0], translateY: [0, -50] }
|
||||
{ opacity: [1, 0], translateY: [0, -50] },
|
||||
]}>
|
||||
{list}
|
||||
</QueueAnim>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -11,12 +11,12 @@ import { QueueAnim, Button } from 'antd';
|
||||
const Test = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
show: true
|
||||
show: true,
|
||||
};
|
||||
},
|
||||
onClick() {
|
||||
this.setState({
|
||||
show: !this.state.show
|
||||
show: !this.state.show,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -37,7 +37,7 @@ const Test = React.createClass({
|
||||
<li></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>,
|
||||
] : null;
|
||||
return (
|
||||
<div>
|
||||
@ -52,7 +52,7 @@ const Test = React.createClass({
|
||||
</QueueAnim>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -13,12 +13,12 @@ const RadioGroup = Radio.Group;
|
||||
const Test = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
show: true
|
||||
show: true,
|
||||
};
|
||||
},
|
||||
onClick() {
|
||||
this.setState({
|
||||
show: !this.state.show
|
||||
show: !this.state.show,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -57,7 +57,7 @@ const Test = React.createClass({
|
||||
</QueueAnim>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -11,12 +11,12 @@ import { QueueAnim, Button } from 'antd';
|
||||
const Test = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
show: true
|
||||
show: true,
|
||||
};
|
||||
},
|
||||
onClick() {
|
||||
this.setState({
|
||||
show: !this.state.show
|
||||
show: !this.state.show,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -59,7 +59,7 @@ const Test = React.createClass({
|
||||
</QueueAnim>,
|
||||
<QueueAnim delay={1000} type="bottom" key="footerBox">
|
||||
<div className="demo-footer" key="footer"></div>
|
||||
</QueueAnim>
|
||||
</QueueAnim>,
|
||||
] : null;
|
||||
return (
|
||||
<div>
|
||||
@ -69,7 +69,7 @@ const Test = React.createClass({
|
||||
<QueueAnim type={['right', 'left']}>{page}</QueueAnim>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -11,12 +11,12 @@ import { Radio, Button } from 'antd';
|
||||
const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
};
|
||||
},
|
||||
toggleDisabled() {
|
||||
this.setState({
|
||||
disabled: !this.state.disabled
|
||||
disabled: !this.state.disabled,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -32,7 +32,7 @@ const App = React.createClass({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -38,7 +38,7 @@ const App = React.createClass({
|
||||
</Radio>
|
||||
</RadioGroup>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -30,7 +30,7 @@ const App = React.createClass({
|
||||
<Radio key="d" value={4}>D</Radio>
|
||||
</RadioGroup>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -4,7 +4,7 @@ import classNames from 'classnames';
|
||||
|
||||
export default class Radio extends React.Component {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-radio'
|
||||
prefixCls: 'ant-radio',
|
||||
}
|
||||
render() {
|
||||
const { prefixCls, children, checked, disabled, className, style } = this.props;
|
||||
|
@ -26,7 +26,7 @@ const Rater = React.createClass({
|
||||
{value && <span className="ant-rate-text">{value} 星</span>}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Rater />, mountNode);
|
||||
|
@ -38,7 +38,7 @@ const Test = React.createClass({
|
||||
{this.state.options}
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -14,25 +14,25 @@ const Option = Select.Option;
|
||||
const provinceData = ['浙江', '江苏'];
|
||||
const cityData = {
|
||||
浙江: ['杭州', '宁波', '温州'],
|
||||
江苏: ['南京', '苏州', '镇江']
|
||||
江苏: ['南京', '苏州', '镇江'],
|
||||
};
|
||||
|
||||
const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
cities: cityData[provinceData[0]],
|
||||
secondCity: cityData[provinceData[0]][0]
|
||||
secondCity: cityData[provinceData[0]][0],
|
||||
};
|
||||
},
|
||||
handleProvinceChange(value) {
|
||||
this.setState({
|
||||
cities: cityData[value],
|
||||
secondCity: cityData[value][0]
|
||||
secondCity: cityData[value][0],
|
||||
});
|
||||
},
|
||||
onSecondCityChange(value) {
|
||||
this.setState({
|
||||
secondCity: value
|
||||
secondCity: value,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -48,7 +48,7 @@ const App = React.createClass({
|
||||
</Select>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
````
|
||||
|
@ -17,7 +17,7 @@ const IconSlider = React.createClass({
|
||||
preIconClass: this.props.value >= mid ? '' : 'anticon-highlight',
|
||||
nextIconClass: this.props.value >= mid ? 'anticon-highlight' : '',
|
||||
mid,
|
||||
sliderValue: this.props.value
|
||||
sliderValue: this.props.value,
|
||||
};
|
||||
},
|
||||
|
||||
@ -25,7 +25,7 @@ const IconSlider = React.createClass({
|
||||
this.setState({
|
||||
preIconClass: v >= this.state.mid ? '' : 'anticon-highlight',
|
||||
nextIconClass: v >= this.state.mid ? 'anticon-highlight' : '',
|
||||
sliderValue: v
|
||||
sliderValue: v,
|
||||
});
|
||||
},
|
||||
|
||||
@ -37,7 +37,7 @@ const IconSlider = React.createClass({
|
||||
<Icon className={this.state.nextIconClass} type={this.props.icon[1]} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
|
@ -11,12 +11,12 @@ import { Slider, InputNumber, Row, Col } from 'antd';
|
||||
const IntegerStep = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
inputValue: 1
|
||||
inputValue: 1,
|
||||
};
|
||||
},
|
||||
onChange(value) {
|
||||
this.setState({
|
||||
inputValue: value
|
||||
inputValue: value,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -31,18 +31,18 @@ const IntegerStep = React.createClass({
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const DecimalStep = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
inputValue: 0
|
||||
inputValue: 0,
|
||||
};
|
||||
},
|
||||
onChange(value) {
|
||||
this.setState({
|
||||
inputValue: value
|
||||
inputValue: value,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -57,7 +57,7 @@ const DecimalStep = React.createClass({
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<div>
|
||||
|
@ -4,7 +4,7 @@ import RcSlider from 'rc-slider';
|
||||
export default class Slider extends React.Component {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-slider',
|
||||
tipTransitionName: 'zoom-down'
|
||||
tipTransitionName: 'zoom-down',
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -27,7 +27,7 @@ const Card = React.createClass({
|
||||
切换加载状态:<Switch checked={this.state.loading} onChange={this.toggle} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Card />, mountNode);
|
||||
|
@ -11,16 +11,16 @@ const Step = Steps.Step;
|
||||
|
||||
const steps = [{
|
||||
title: '已完成',
|
||||
description: '这里是多信息的描述啊'
|
||||
description: '这里是多信息的描述啊',
|
||||
}, {
|
||||
title: '错误示例',
|
||||
description: '这里是多信息的耶哦耶哦哦耶哦耶'
|
||||
description: '这里是多信息的耶哦耶哦哦耶哦耶',
|
||||
}, {
|
||||
title: '又一个待运行',
|
||||
description: '描述啊描述啊'
|
||||
description: '描述啊描述啊',
|
||||
}, {
|
||||
title: '待运行',
|
||||
description: '这里是多信息的描述啊'
|
||||
description: '这里是多信息的描述啊',
|
||||
}].map((s, i) => <Step key={i} title={s.title} description={s.description} />);
|
||||
|
||||
ReactDOM.render(<Steps current={1} status="error">{steps}</Steps>, mountNode);
|
||||
|
@ -11,16 +11,16 @@ const Step = Steps.Step;
|
||||
|
||||
const steps = [{
|
||||
title: '已完成',
|
||||
description: '这里是多信息的描述啊'
|
||||
description: '这里是多信息的描述啊',
|
||||
}, {
|
||||
title: '进行中',
|
||||
description: '这里是多信息的耶哦耶哦哦耶哦耶'
|
||||
description: '这里是多信息的耶哦耶哦哦耶哦耶',
|
||||
}, {
|
||||
title: '又一个待运行',
|
||||
description: '描述啊描述啊'
|
||||
description: '描述啊描述啊',
|
||||
}, {
|
||||
title: '待运行',
|
||||
description: '这里是多信息的描述啊'
|
||||
description: '这里是多信息的描述啊',
|
||||
}].map((s, i) => <Step key={i} title={s.title} description={s.description} />);
|
||||
|
||||
ReactDOM.render(<Steps current={1}>{steps}</Steps>, mountNode);
|
||||
|
@ -11,16 +11,16 @@ const Step = Steps.Step;
|
||||
|
||||
const steps = [{
|
||||
status: 'finish',
|
||||
title: '已完成'
|
||||
title: '已完成',
|
||||
}, {
|
||||
status: 'process',
|
||||
title: '进行中'
|
||||
title: '进行中',
|
||||
}, {
|
||||
status: 'wait',
|
||||
title: '待运行'
|
||||
title: '待运行',
|
||||
}, {
|
||||
status: 'wait',
|
||||
title: '待运行'
|
||||
title: '待运行',
|
||||
}].map((s, i) => <Step key={i} title={s.title} description={s.description} />);
|
||||
|
||||
ReactDOM.render(<Steps size="small" current={1}>{steps}</Steps>, mountNode);
|
||||
|
@ -17,14 +17,14 @@ const Step = Steps.Step;
|
||||
const array = Array.apply(null, Array(Math.floor(Math.random() * 3) + 3));
|
||||
const steps = array.map((item, i) => {
|
||||
return {
|
||||
title: `步骤${i + 1}`
|
||||
title: `步骤${i + 1}`,
|
||||
};
|
||||
});
|
||||
|
||||
const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
currentStep: Math.floor(Math.random() * steps.length)
|
||||
currentStep: Math.floor(Math.random() * steps.length),
|
||||
};
|
||||
},
|
||||
next() {
|
||||
@ -33,7 +33,7 @@ const App = React.createClass({
|
||||
s = 0;
|
||||
}
|
||||
this.setState({
|
||||
currentStep: s
|
||||
currentStep: s,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -49,7 +49,7 @@ const App = React.createClass({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -11,13 +11,13 @@ const Step = Steps.Step;
|
||||
|
||||
const steps = [{
|
||||
title: '已完成',
|
||||
description: '这里是信息的描述'
|
||||
description: '这里是信息的描述',
|
||||
}, {
|
||||
title: '进行中',
|
||||
description: '这里是信息的描述'
|
||||
description: '这里是信息的描述',
|
||||
}, {
|
||||
title: '待运行',
|
||||
description: '这里是信息的描述'
|
||||
description: '这里是信息的描述',
|
||||
}].map((s, i) => <Step key={i} title={s.title} description={s.description} />);
|
||||
|
||||
ReactDOM.render(<Steps size="small" direction="vertical" current={1}>{steps}</Steps>,
|
||||
|
@ -11,16 +11,16 @@ const Step = Steps.Step;
|
||||
|
||||
const steps = [{
|
||||
title: '已完成',
|
||||
description: '这里是信息的描述'
|
||||
description: '这里是信息的描述',
|
||||
}, {
|
||||
title: '进行中',
|
||||
description: '这里是信息的描述'
|
||||
description: '这里是信息的描述',
|
||||
}, {
|
||||
title: '待运行',
|
||||
description: '这里是信息的描述'
|
||||
description: '这里是信息的描述',
|
||||
}, {
|
||||
title: '又一个待运行',
|
||||
description: '这里是信息的描述'
|
||||
description: '这里是信息的描述',
|
||||
}].map((s, i) => <Step key={i} title={s.title} description={s.description} />);
|
||||
|
||||
ReactDOM.render(<Steps direction="vertical" current={1}>{steps}</Steps>,
|
||||
|
@ -11,12 +11,12 @@ import { Switch, Button } from 'antd';
|
||||
const Test = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
};
|
||||
},
|
||||
toggle() {
|
||||
this.setState({
|
||||
disabled: !this.state.disabled
|
||||
disabled: !this.state.disabled,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -28,7 +28,7 @@ const Test = React.createClass({
|
||||
<Button type="primary" onClick={this.toggle}>Toggle disabled</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -69,7 +69,7 @@ const Test = React.createClass({
|
||||
data: result.data,
|
||||
pagination,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
componentDidMount() {
|
||||
@ -83,7 +83,7 @@ const Test = React.createClass({
|
||||
loading={this.state.loading}
|
||||
onChange={this.handleTableChange} />
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -13,7 +13,7 @@ const columns = [{
|
||||
dataIndex: 'name',
|
||||
render(text) {
|
||||
return <a href="#">{text}</a>;
|
||||
}
|
||||
},
|
||||
}, {
|
||||
title: '资产',
|
||||
className: 'column-money',
|
||||
|
@ -15,7 +15,7 @@ import { Table } from 'antd';
|
||||
const renderContent = function (value, row, index) {
|
||||
let obj = {
|
||||
children: value,
|
||||
props: {}
|
||||
props: {},
|
||||
};
|
||||
if (index === 4) {
|
||||
obj.props.colSpan = 0;
|
||||
@ -33,14 +33,14 @@ const columns = [{
|
||||
return {
|
||||
children: <a href="#">{text}</a>,
|
||||
props: {
|
||||
colSpan: 5
|
||||
}
|
||||
colSpan: 5,
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
}, {
|
||||
title: '年龄',
|
||||
dataIndex: 'age',
|
||||
render: renderContent
|
||||
render: renderContent,
|
||||
}, {
|
||||
title: '家庭电话',
|
||||
colSpan: 2,
|
||||
@ -48,7 +48,7 @@ const columns = [{
|
||||
render(value, row, index) {
|
||||
let obj = {
|
||||
children: value,
|
||||
props: {}
|
||||
props: {},
|
||||
};
|
||||
// 第三列的第三行行合并
|
||||
if (index === 2) {
|
||||
@ -64,16 +64,16 @@ const columns = [{
|
||||
obj.props.colSpan = 0;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
},
|
||||
}, {
|
||||
title: '手机号',
|
||||
colSpan: 0,
|
||||
dataIndex: 'phone',
|
||||
render: renderContent
|
||||
render: renderContent,
|
||||
}, {
|
||||
title: '住址',
|
||||
dataIndex: 'address',
|
||||
render: renderContent
|
||||
render: renderContent,
|
||||
}];
|
||||
|
||||
const data = [{
|
||||
|
@ -29,7 +29,7 @@ for (let i = 0; i < 100; i++) {
|
||||
key: i,
|
||||
name: `李大嘴${i}`,
|
||||
age: 32,
|
||||
address: `西湖区湖底公园${i}号`
|
||||
address: `西湖区湖底公园${i}号`,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -38,12 +38,12 @@ const data = [{
|
||||
const App = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
loading: false
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
toggleLoading() {
|
||||
this.setState({
|
||||
loading: !this.state.loading
|
||||
loading: !this.state.loading,
|
||||
});
|
||||
},
|
||||
render() {
|
||||
@ -53,7 +53,7 @@ const App = React.createClass({
|
||||
<Button type="primary" onClick={this.toggleLoading}>切换 loading 状态</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -23,17 +23,17 @@ const data = [{
|
||||
key: '1',
|
||||
name: '胡彦斌',
|
||||
age: 32,
|
||||
address: '西湖区湖底公园1号'
|
||||
address: '西湖区湖底公园1号',
|
||||
}, {
|
||||
key: '2',
|
||||
name: '胡彦祖',
|
||||
age: 42,
|
||||
address: '西湖区湖底公园1号'
|
||||
address: '西湖区湖底公园1号',
|
||||
}, {
|
||||
key: '3',
|
||||
name: '李大嘴',
|
||||
age: 32,
|
||||
address: '西湖区湖底公园1号'
|
||||
address: '西湖区湖底公园1号',
|
||||
}];
|
||||
|
||||
ReactDOM.render(<Table columns={columns} dataSource={data} pagination={false} />
|
||||
|
@ -13,13 +13,13 @@ const columns = [{
|
||||
dataIndex: 'name',
|
||||
render(text) {
|
||||
return <a href="#">{text}</a>;
|
||||
}
|
||||
},
|
||||
}, {
|
||||
title: '年龄',
|
||||
dataIndex: 'age'
|
||||
dataIndex: 'age',
|
||||
}, {
|
||||
title: '住址',
|
||||
dataIndex: 'address'
|
||||
dataIndex: 'address',
|
||||
}];
|
||||
|
||||
const data = [];
|
||||
@ -28,7 +28,7 @@ for (let i = 0; i < 46; i++) {
|
||||
key: i,
|
||||
name: `李大嘴${i}`,
|
||||
age: 32,
|
||||
address: `西湖区湖底公园${i}号`
|
||||
address: `西湖区湖底公园${i}号`,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ const App = React.createClass({
|
||||
<Table columns={columns} dataSource={data} onChange={this.handleChange} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -67,7 +67,7 @@ const App = React.createClass({
|
||||
<Table rowSelection={rowSelection} columns={columns} dataSource={data} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -16,7 +16,7 @@ const columns = [{
|
||||
},
|
||||
}, {
|
||||
title: '年龄',
|
||||
dataIndex: 'age'
|
||||
dataIndex: 'age',
|
||||
}, {
|
||||
title: '住址',
|
||||
dataIndex: 'address',
|
||||
|
@ -7,7 +7,7 @@ import Checkbox from '../checkbox';
|
||||
export default class FilterMenu extends React.Component {
|
||||
static defaultProps = {
|
||||
handleFilter() {},
|
||||
column: null
|
||||
column: null,
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
@ -22,7 +22,7 @@ export default class FilterMenu extends React.Component {
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
this.setState({
|
||||
selectedKeys: nextProps.selectedKeys
|
||||
selectedKeys: nextProps.selectedKeys,
|
||||
});
|
||||
}
|
||||
|
||||
@ -32,13 +32,13 @@ export default class FilterMenu extends React.Component {
|
||||
|
||||
handleClearFilters = () => {
|
||||
this.setState({
|
||||
selectedKeys: []
|
||||
selectedKeys: [],
|
||||
}, this.handleConfirm);
|
||||
}
|
||||
|
||||
handleConfirm = () => {
|
||||
this.setState({
|
||||
visible: false
|
||||
visible: false,
|
||||
});
|
||||
this.props.confirmFilter(this.props.column, this.state.selectedKeys);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ export default class Table extends React.Component {
|
||||
bordered: false,
|
||||
indentSize: 20,
|
||||
onChange: noop,
|
||||
locale: {}
|
||||
locale: {},
|
||||
}
|
||||
|
||||
static contextTypes = {
|
||||
@ -468,7 +468,7 @@ export default class Table extends React.Component {
|
||||
selectionColumn = {
|
||||
key: 'selection-column',
|
||||
render: this.renderSelectionRadio,
|
||||
className: 'ant-table-selection-column'
|
||||
className: 'ant-table-selection-column',
|
||||
};
|
||||
} else {
|
||||
const checkboxAllDisabled = data.every(item =>
|
||||
@ -483,7 +483,7 @@ export default class Table extends React.Component {
|
||||
key: 'selection-column',
|
||||
title: checkboxAll,
|
||||
render: this.renderSelectionCheckBox,
|
||||
className: 'ant-table-selection-column'
|
||||
className: 'ant-table-selection-column',
|
||||
};
|
||||
}
|
||||
if (columns[0] && columns[0].key === 'selection-column') {
|
||||
|
@ -54,7 +54,7 @@ const Demo = React.createClass({
|
||||
{this.state.panes}
|
||||
</Tabs>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Demo />, mountNode);
|
||||
|
@ -39,7 +39,7 @@ const Demo = React.createClass({
|
||||
</Tabs>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Demo />, mountNode);
|
||||
|
@ -44,7 +44,7 @@ const App = React.createClass({
|
||||
<Button size="small" type="primary" onClick={this.addTag}>添加标签</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -20,7 +20,7 @@ const Test = React.createClass({
|
||||
},
|
||||
render() {
|
||||
return <TimePicker value={this.state.value} onChange={this.onChange} />;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<Test />, mountNode);
|
||||
|
@ -84,7 +84,7 @@ export default class Tooltip extends React.Component {
|
||||
onPopupAlign={this.onPopupAlign}
|
||||
ref="tooltip"
|
||||
{...this.props}>
|
||||
{visible ? cloneElement(children, { className: childrenCls, }) : children}
|
||||
{visible ? cloneElement(children, { className: childrenCls }) : children}
|
||||
</RcTooltip>
|
||||
);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ const App = React.createClass({
|
||||
key: i,
|
||||
title: `内容${i + 1}`,
|
||||
description: `内容${i + 1}的描述`,
|
||||
chosen: Math.random() * 2 > 1
|
||||
chosen: Math.random() * 2 > 1,
|
||||
};
|
||||
if (data.chosen) {
|
||||
targetKeys.push(data.key);
|
||||
@ -61,7 +61,7 @@ const App = React.createClass({
|
||||
render={item => `${item.title}-${item.description}`}
|
||||
footer={this.renderFooter} />
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -26,7 +26,7 @@ const App = React.createClass({
|
||||
key: i,
|
||||
title: `内容${i + 1}`,
|
||||
description: `内容${i + 1}的描述`,
|
||||
chosen: Math.random() * 2 > 1
|
||||
chosen: Math.random() * 2 > 1,
|
||||
};
|
||||
if (data.chosen) {
|
||||
targetKeys.push(data.key);
|
||||
@ -55,7 +55,7 @@ const App = React.createClass({
|
||||
onChange={this.handleChange}
|
||||
render={item => item.title} />
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -26,7 +26,7 @@ const App = React.createClass({
|
||||
key: i,
|
||||
title: `内容${i + 1}`,
|
||||
description: `内容${i + 1}的描述`,
|
||||
chosen: Math.random() * 2 > 1
|
||||
chosen: Math.random() * 2 > 1,
|
||||
};
|
||||
if (data.chosen) {
|
||||
targetKeys.push(data.key);
|
||||
@ -48,7 +48,7 @@ const App = React.createClass({
|
||||
onChange={this.handleChange}
|
||||
render={item => item.title} />
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
|
@ -147,7 +147,7 @@ export default class TransferList extends React.Component {
|
||||
prefixCls: 'ant-transfer',
|
||||
checked: checkStatus === 'all',
|
||||
checkPart: checkStatus === 'part',
|
||||
checkable: <span className={'ant-transfer-checkbox-inner'}></span>
|
||||
checkable: <span className={'ant-transfer-checkbox-inner'}></span>,
|
||||
})}
|
||||
<span className={`${prefixCls}-header-selected`}>
|
||||
<span>
|
||||
|
@ -23,7 +23,7 @@ export default class TreeSelect extends React.Component {
|
||||
render() {
|
||||
const props = this.props;
|
||||
let {
|
||||
size, className, combobox, notFoundContent, prefixCls
|
||||
size, className, combobox, notFoundContent, prefixCls,
|
||||
} = this.props;
|
||||
|
||||
const cls = classNames({
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user