mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
style: update code style to please lint
This commit is contained in:
parent
293c012712
commit
9d022ff84c
@ -29,7 +29,6 @@
|
|||||||
"react/jsx-closing-bracket-location": 0,
|
"react/jsx-closing-bracket-location": 0,
|
||||||
"react/jsx-no-bind": 0,
|
"react/jsx-no-bind": 0,
|
||||||
"no-param-reassign": 0,
|
"no-param-reassign": 0,
|
||||||
"max-len": 0,
|
"max-len": 0
|
||||||
"object-shorthand": 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,10 @@ function showConfirm() {
|
|||||||
confirm({
|
confirm({
|
||||||
title: '您是否确认要删除这项内容',
|
title: '您是否确认要删除这项内容',
|
||||||
content: '一些解释',
|
content: '一些解释',
|
||||||
onOk: function () {
|
onOk() {
|
||||||
console.log('确定');
|
console.log('确定');
|
||||||
},
|
},
|
||||||
onCancel: function () {}
|
onCancel() {}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
import { Modal, Button } from 'antd';
|
import { Modal, Button } from 'antd';
|
||||||
|
|
||||||
const Test = React.createClass({
|
const Test = React.createClass({
|
||||||
getInitialState: function () {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
visible: false
|
visible: false
|
||||||
|
@ -13,7 +13,7 @@ function info() {
|
|||||||
Modal.info({
|
Modal.info({
|
||||||
title: '这是一条通知信息',
|
title: '这是一条通知信息',
|
||||||
content: '一些附加信息一些附加信息一些附加信息',
|
content: '一些附加信息一些附加信息一些附加信息',
|
||||||
onOk: function () {}
|
onOk() {}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ const openNotification = function () {
|
|||||||
notification.open({
|
notification.open({
|
||||||
message: '这是标题',
|
message: '这是标题',
|
||||||
description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案',
|
description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案',
|
||||||
btn: btn,
|
btn,
|
||||||
key: key,
|
key,
|
||||||
onClose: close
|
onClose: close
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -30,7 +30,7 @@ const Test = React.createClass({
|
|||||||
items.push(<li key={Date.now()}></li>);
|
items.push(<li key={Date.now()}></li>);
|
||||||
this.setState({
|
this.setState({
|
||||||
show: true,
|
show: true,
|
||||||
items: items,
|
items,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onRemove() {
|
onRemove() {
|
||||||
@ -38,7 +38,7 @@ const Test = React.createClass({
|
|||||||
items.splice(items.length - 1, 1);
|
items.splice(items.length - 1, 1);
|
||||||
this.setState({
|
this.setState({
|
||||||
show: true,
|
show: true,
|
||||||
items: items,
|
items,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
|
@ -29,7 +29,7 @@ const App = React.createClass({
|
|||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
<QueueAnim type={['right', 'left']} className="demo-router-wrap">
|
<QueueAnim type={['right', 'left']} className="demo-router-wrap">
|
||||||
{React.cloneElement(this.props.children || <Home/>, { key: key })}
|
{React.cloneElement(this.props.children || <Home/>, { key })}
|
||||||
</QueueAnim>
|
</QueueAnim>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -11,7 +11,7 @@ import { Radio } from 'antd';
|
|||||||
const RadioGroup = Radio.Group;
|
const RadioGroup = Radio.Group;
|
||||||
|
|
||||||
const App = React.createClass({
|
const App = React.createClass({
|
||||||
getInitialState: function () {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
value: 'a'
|
value: 'a'
|
||||||
};
|
};
|
||||||
|
@ -18,7 +18,7 @@ const IconSlider = React.createClass({
|
|||||||
return {
|
return {
|
||||||
preIconClass: this.props.value >= mid ? '' : 'anticon-highlight',
|
preIconClass: this.props.value >= mid ? '' : 'anticon-highlight',
|
||||||
nextIconClass: this.props.value >= mid ? 'anticon-highlight' : '',
|
nextIconClass: this.props.value >= mid ? 'anticon-highlight' : '',
|
||||||
mid: mid,
|
mid,
|
||||||
sliderValue: this.props.value
|
sliderValue: this.props.value
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -13,7 +13,7 @@ const columns = [{
|
|||||||
title: '姓名',
|
title: '姓名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
render: function (text) {
|
render(text) {
|
||||||
return <a href="#">{text}</a>;
|
return <a href="#">{text}</a>;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -27,7 +27,7 @@ const columns = [{
|
|||||||
}, {
|
}, {
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'operation',
|
key: 'operation',
|
||||||
render: function (text, record) {
|
render(text, record) {
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
<a href="#">操作一{record.name}</a>
|
<a href="#">操作一{record.name}</a>
|
||||||
|
@ -12,7 +12,7 @@ import { Table } from 'antd';
|
|||||||
const columns = [{
|
const columns = [{
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
render: function (text) {
|
render(text) {
|
||||||
return <a href="#">{text}</a>;
|
return <a href="#">{text}</a>;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
@ -27,7 +27,7 @@ const renderContent = function (value, row, index) {
|
|||||||
const columns = [{
|
const columns = [{
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
render: function (text, row, index) {
|
render(text, row, index) {
|
||||||
if (index < 4) {
|
if (index < 4) {
|
||||||
return <a href="#">{text}</a>;
|
return <a href="#">{text}</a>;
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ const columns = [{
|
|||||||
title: '家庭电话',
|
title: '家庭电话',
|
||||||
colSpan: 2,
|
colSpan: 2,
|
||||||
dataIndex: 'tel',
|
dataIndex: 'tel',
|
||||||
render: function (value, row, index) {
|
render(value, row, index) {
|
||||||
let obj = {
|
let obj = {
|
||||||
children: value,
|
children: value,
|
||||||
props: {}
|
props: {}
|
||||||
|
@ -33,16 +33,16 @@ const columns = [{
|
|||||||
}],
|
}],
|
||||||
// 指定确定筛选的条件函数
|
// 指定确定筛选的条件函数
|
||||||
// 这里是名字中第一个字是 value
|
// 这里是名字中第一个字是 value
|
||||||
onFilter: function (value, record) {
|
onFilter(value, record) {
|
||||||
return record.name.indexOf(value) === 0;
|
return record.name.indexOf(value) === 0;
|
||||||
},
|
},
|
||||||
sorter: function (a, b) {
|
sorter(a, b) {
|
||||||
return a.name.length - b.name.length;
|
return a.name.length - b.name.length;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
title: '年龄',
|
title: '年龄',
|
||||||
dataIndex: 'age',
|
dataIndex: 'age',
|
||||||
sorter: function (a, b) {
|
sorter(a, b) {
|
||||||
return a.age - b.age;
|
return a.age - b.age;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -56,10 +56,10 @@ const columns = [{
|
|||||||
value: '西湖'
|
value: '西湖'
|
||||||
}],
|
}],
|
||||||
filterMultiple: false,
|
filterMultiple: false,
|
||||||
onFilter: function (value, record) {
|
onFilter(value, record) {
|
||||||
return record.address.indexOf(value) === 0;
|
return record.address.indexOf(value) === 0;
|
||||||
},
|
},
|
||||||
sorter: function (a, b) {
|
sorter(a, b) {
|
||||||
return a.address.length - b.address.length;
|
return a.address.length - b.address.length;
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
@ -12,7 +12,7 @@ import { Table } from 'antd';
|
|||||||
const columns = [{
|
const columns = [{
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
render: function (text) {
|
render(text) {
|
||||||
return <a href="#">{text}</a>;
|
return <a href="#">{text}</a>;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -37,10 +37,10 @@ const pagination = {
|
|||||||
total: data.length,
|
total: data.length,
|
||||||
current: 1,
|
current: 1,
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
onShowSizeChange: function (current, pageSize) {
|
onShowSizeChange(current, pageSize) {
|
||||||
console.log('Current: ', current, '; PageSize: ', pageSize);
|
console.log('Current: ', current, '; PageSize: ', pageSize);
|
||||||
},
|
},
|
||||||
onChange: function (current) {
|
onChange(current) {
|
||||||
console.log('Current: ', current);
|
console.log('Current: ', current);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -12,7 +12,7 @@ import { Table } from 'antd';
|
|||||||
const columns = [{
|
const columns = [{
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
render: function (text) {
|
render(text) {
|
||||||
return <a href="#">{text}</a>;
|
return <a href="#">{text}</a>;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -41,7 +41,7 @@ const data = [{
|
|||||||
|
|
||||||
// 通过 rowSelection 对象表明需要行选择
|
// 通过 rowSelection 对象表明需要行选择
|
||||||
const rowSelection = {
|
const rowSelection = {
|
||||||
getCheckboxProps: function (record) {
|
getCheckboxProps(record) {
|
||||||
return {
|
return {
|
||||||
defaultChecked: record.name === '李大嘴', // 配置默认勾选的列
|
defaultChecked: record.name === '李大嘴', // 配置默认勾选的列
|
||||||
disabled: record.name === '胡彦祖' // 配置无法勾选的列
|
disabled: record.name === '胡彦祖' // 配置无法勾选的列
|
||||||
@ -50,10 +50,10 @@ const rowSelection = {
|
|||||||
onChange(selectedRowKeys) {
|
onChange(selectedRowKeys) {
|
||||||
console.log('selectedRowKeys changed: ' + selectedRowKeys);
|
console.log('selectedRowKeys changed: ' + selectedRowKeys);
|
||||||
},
|
},
|
||||||
onSelect: function (record, selected, selectedRows) {
|
onSelect(record, selected, selectedRows) {
|
||||||
console.log(record, selected, selectedRows);
|
console.log(record, selected, selectedRows);
|
||||||
},
|
},
|
||||||
onSelectAll: function (selected, selectedRows) {
|
onSelectAll(selected, selectedRows) {
|
||||||
console.log(selected, selectedRows);
|
console.log(selected, selectedRows);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -12,7 +12,7 @@ import { Table } from 'antd';
|
|||||||
const columns = [{
|
const columns = [{
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
render: function (text) {
|
render(text) {
|
||||||
return <a href="#">{text}</a>;
|
return <a href="#">{text}</a>;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -44,10 +44,10 @@ const rowSelection = {
|
|||||||
onChange(selectedRowKeys) {
|
onChange(selectedRowKeys) {
|
||||||
console.log('selectedRowKeys changed: ' + selectedRowKeys);
|
console.log('selectedRowKeys changed: ' + selectedRowKeys);
|
||||||
},
|
},
|
||||||
onSelect: function (record, selected, selectedRows) {
|
onSelect(record, selected, selectedRows) {
|
||||||
console.log(record, selected, selectedRows);
|
console.log(record, selected, selectedRows);
|
||||||
},
|
},
|
||||||
onSelectAll: function (selected, selectedRows) {
|
onSelectAll(selected, selectedRows) {
|
||||||
console.log(selected, selectedRows);
|
console.log(selected, selectedRows);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -19,7 +19,7 @@ const Demo = React.createClass({
|
|||||||
];
|
];
|
||||||
return {
|
return {
|
||||||
activeKey: panes[0].key,
|
activeKey: panes[0].key,
|
||||||
panes: panes,
|
panes,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onChange(activeKey) {
|
onChange(activeKey) {
|
||||||
|
@ -22,7 +22,7 @@ const generateData = (_level, _preKey, _tns) => {
|
|||||||
const children = [];
|
const children = [];
|
||||||
for (let i = 0; i < x; i++) {
|
for (let i = 0; i < x; i++) {
|
||||||
const key = `${preKey}-${i}`;
|
const key = `${preKey}-${i}`;
|
||||||
tns.push({ title: key, key: key });
|
tns.push({ title: key, key });
|
||||||
if (i < y) {
|
if (i < y) {
|
||||||
children.push(key);
|
children.push(key);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ const generateData = (_level, _preKey, _tns) => {
|
|||||||
const children = [];
|
const children = [];
|
||||||
for (let i = 0; i < x; i++) {
|
for (let i = 0; i < x; i++) {
|
||||||
const key = `${preKey}-${i}`;
|
const key = `${preKey}-${i}`;
|
||||||
tns.push({ title: key, key: key });
|
tns.push({ title: key, key });
|
||||||
if (i < y) {
|
if (i < y) {
|
||||||
children.push(key);
|
children.push(key);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import { Upload, Button, Icon, message } from 'antd';
|
|||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
action: '/upload.do',
|
action: '/upload.do',
|
||||||
beforeUpload: function (file) {
|
beforeUpload(file) {
|
||||||
const isJPG = file.type === 'image/jpeg';
|
const isJPG = file.type === 'image/jpeg';
|
||||||
if (!isJPG) {
|
if (!isJPG) {
|
||||||
message.error('只能上传 JPG 文件哦!');
|
message.error('只能上传 JPG 文件哦!');
|
||||||
|
Loading…
Reference in New Issue
Block a user