style: update code style for space-before-function-paren

This commit is contained in:
Benjy Cui 2016-01-27 16:53:05 +08:00
parent cd1391e6a2
commit 68b51e298d
24 changed files with 44 additions and 45 deletions

View File

@ -28,7 +28,6 @@
"react/prefer-es6-class": 0, "react/prefer-es6-class": 0,
"react/jsx-closing-bracket-location": 0, "react/jsx-closing-bracket-location": 0,
"react/jsx-no-bind": 0, "react/jsx-no-bind": 0,
"space-before-function-paren": 0,
"no-param-reassign": 0, "no-param-reassign": 0,
"max-len": 0, "max-len": 0,
"object-shorthand": 0, "object-shorthand": 0,

View File

@ -9,7 +9,7 @@
````jsx ````jsx
import { Alert } from 'antd'; import { Alert } from 'antd';
const onClose = function(e) { const onClose = function (e) {
console.log(e, '我要被关闭啦!'); console.log(e, '我要被关闭啦!');
}; };

View File

@ -11,7 +11,7 @@
````jsx ````jsx
import { DatePicker } from 'antd'; import { DatePicker } from 'antd';
const disabledDate = function(current) { const disabledDate = function (current) {
// can not select days after today // can not select days after today
return current && current.getTime() > Date.now(); return current && current.getTime() > Date.now();
}; };

View File

@ -8,7 +8,7 @@
````jsx ````jsx
import { Menu, Dropdown, Icon } from 'antd'; import { Menu, Dropdown, Icon } from 'antd';
const onClick = function({ key }) { const onClick = function ({ key }) {
console.log('点击了菜单' + key); console.log('点击了菜单' + key);
}; };

View File

@ -9,7 +9,7 @@
````jsx ````jsx
import { message, Button } from 'antd'; import { message, Button } from 'antd';
const success = function() { const success = function () {
message.success('这是一条成功的提示,并将于10秒后消失', 10); message.success('这是一条成功的提示,并将于10秒后消失', 10);
}; };

View File

@ -9,7 +9,7 @@
````jsx ````jsx
import { message, Button } from 'antd'; import { message, Button } from 'antd';
const info = function() { const info = function () {
message.info('这是一条普通的提醒'); message.info('这是一条普通的提醒');
}; };

View File

@ -9,7 +9,7 @@
````jsx ````jsx
import { message, Button } from 'antd'; import { message, Button } from 'antd';
const success = function() { const success = function () {
let hide = message.loading('正在执行中...', 0); let hide = message.loading('正在执行中...', 0);
// 异步手动移除 // 异步手动移除
setTimeout(hide, 2500); setTimeout(hide, 2500);

View File

@ -9,15 +9,15 @@
````jsx ````jsx
import { message, Button } from 'antd'; import { message, Button } from 'antd';
const success = function() { const success = function () {
message.success('这是一条成功提示'); message.success('这是一条成功提示');
}; };
const error = function() { const error = function () {
message.error('这是一条报错提示'); message.error('这是一条报错提示');
}; };
const warn = function() { const warn = function () {
message.warn('这是一条警告提示'); message.warn('这是一条警告提示');
}; };

View File

@ -14,10 +14,10 @@ function showConfirm() {
confirm({ confirm({
title: '您是否确认要删除这项内容', title: '您是否确认要删除这项内容',
content: '一些解释', content: '一些解释',
onOk: function() { onOk: function () {
console.log('确定'); console.log('确定');
}, },
onCancel: function() {} onCancel: function () {}
}); });
} }

View File

@ -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: function () {
return { return {
loading: false, loading: false,
visible: false visible: false

View File

@ -13,7 +13,7 @@ function info() {
Modal.info({ Modal.info({
title: '这是一条通知信息', title: '这是一条通知信息',
content: '一些附加信息一些附加信息一些附加信息', content: '一些附加信息一些附加信息一些附加信息',
onOk: function() {} onOk: function () {}
}); });
} }

View File

@ -9,7 +9,7 @@
````jsx ````jsx
import { Button, notification } from 'antd'; import { Button, notification } from 'antd';
const openNotification = function() { const openNotification = function () {
notification.open({ notification.open({
message: '这是标题', message: '这是标题',
description: '这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案' description: '这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案'

View File

@ -9,7 +9,7 @@
````jsx ````jsx
import { Button, notification } from 'antd'; import { Button, notification } from 'antd';
const openNotification = function() { const openNotification = function () {
const args = { const args = {
message: '这是标题', message: '这是标题',
description: '我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭', description: '我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭',

View File

@ -9,11 +9,11 @@
````jsx ````jsx
import { Button, notification } from 'antd'; import { Button, notification } from 'antd';
const close = function() { const close = function () {
console.log('我被默认的关闭按钮关闭了!'); console.log('我被默认的关闭按钮关闭了!');
}; };
const openNotification = function() { const openNotification = function () {
const args = { const args = {
message: '这是标题', message: '这是标题',
description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案', description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案',

View File

@ -9,13 +9,13 @@
````jsx ````jsx
import { Button, notification } from 'antd'; import { Button, notification } from 'antd';
const close = function() { const close = function () {
console.log('我被默认的关闭按钮关闭了!'); console.log('我被默认的关闭按钮关闭了!');
}; };
const openNotification = function() { const openNotification = function () {
const key = 'open' + Date.now(); const key = 'open' + Date.now();
const btnClick = function() { const btnClick = function () {
// 隐藏提醒框 // 隐藏提醒框
notification.close(key); notification.close(key);
}; };

View File

@ -9,8 +9,8 @@
````jsx ````jsx
import { Button, notification } from 'antd'; import { Button, notification } from 'antd';
const openNotificationWithIcon = function(type) { const openNotificationWithIcon = function (type) {
return function() { return function () {
notification[type]({ notification[type]({
message: '这是标题', message: '这是标题',
description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案' description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案'

View File

@ -13,7 +13,7 @@ const columns = [{
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
render: function(text) { render: function (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: function (text, record) {
return ( return (
<span> <span>
<a href="#">操作一{record.name}</a> <a href="#">操作一{record.name}</a>

View File

@ -12,7 +12,7 @@ import { Table } from 'antd';
const columns = [{ const columns = [{
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
render: function(text) { render: function (text) {
return <a href="#">{text}</a>; return <a href="#">{text}</a>;
} }
}, { }, {

View File

@ -13,7 +13,7 @@ import { Table } from 'antd';
// 事例表中第四行合并了五列,除了第一列设置 colSpan = 5 外 // 事例表中第四行合并了五列,除了第一列设置 colSpan = 5 外
// 其他列的第四行 colSpan = 0 (被合并掉,不会渲染) // 其他列的第四行 colSpan = 0 (被合并掉,不会渲染)
const renderContent = function(value, row, index) { const renderContent = function (value, row, index) {
let obj = { let obj = {
children: value, children: value,
props: {} props: {}
@ -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: function (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: function (value, row, index) {
let obj = { let obj = {
children: value, children: value,
props: {} props: {}

View File

@ -33,16 +33,16 @@ const columns = [{
}], }],
// 指定确定筛选的条件函数 // 指定确定筛选的条件函数
// 这里是名字中第一个字是 value // 这里是名字中第一个字是 value
onFilter: function(value, record) { onFilter: function (value, record) {
return record.name.indexOf(value) === 0; return record.name.indexOf(value) === 0;
}, },
sorter: function(a, b) { sorter: function (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: function (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: function (value, record) {
return record.address.indexOf(value) === 0; return record.address.indexOf(value) === 0;
}, },
sorter: function(a, b) { sorter: function (a, b) {
return a.address.length - b.address.length; return a.address.length - b.address.length;
} }
}]; }];

View File

@ -12,7 +12,7 @@ import { Table } from 'antd';
const columns = [{ const columns = [{
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
render: function(text) { render: function (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: function (current, pageSize) {
console.log('Current: ', current, '; PageSize: ', pageSize); console.log('Current: ', current, '; PageSize: ', pageSize);
}, },
onChange: function(current) { onChange: function (current) {
console.log('Current: ', current); console.log('Current: ', current);
} }
}; };

View File

@ -12,7 +12,7 @@ import { Table } from 'antd';
const columns = [{ const columns = [{
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
render: function(text) { render: function (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: function (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: function (record, selected, selectedRows) {
console.log(record, selected, selectedRows); console.log(record, selected, selectedRows);
}, },
onSelectAll: function(selected, selectedRows) { onSelectAll: function (selected, selectedRows) {
console.log(selected, selectedRows); console.log(selected, selectedRows);
}, },
}; };

View File

@ -12,7 +12,7 @@ import { Table } from 'antd';
const columns = [{ const columns = [{
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
render: function(text) { render: function (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: function (record, selected, selectedRows) {
console.log(record, selected, selectedRows); console.log(record, selected, selectedRows);
}, },
onSelectAll: function(selected, selectedRows) { onSelectAll: function (selected, selectedRows) {
console.log(selected, selectedRows); console.log(selected, selectedRows);
} }
}; };

View File

@ -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: function (file) {
const isJPG = file.type === 'image/jpeg'; const isJPG = file.type === 'image/jpeg';
if (!isJPG) { if (!isJPG) {
message.error('只能上传 JPG 文件哦!'); message.error('只能上传 JPG 文件哦!');