From 26085cc3f8db19ab6ae71d857e0e0668dcea3cd2 Mon Sep 17 00:00:00 2001 From: huyueb <1062887235@qq.com> Date: Tue, 28 Nov 2017 16:24:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/multiSelect.js | 6 +++--- src/lib/sort.js | 14 +++++++------- src/lib/sum.js | 6 ++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/lib/multiSelect.js b/src/lib/multiSelect.js index a2873de..b4e683b 100644 --- a/src/lib/multiSelect.js +++ b/src/lib/multiSelect.js @@ -8,7 +8,7 @@ import Checkbox from "bee-checkbox"; * getSelectedDataFunc--function,能获取到选中的数据 * 使用全选时得注意,data中的key值一定要是唯一值 */ -module.exports = function multiSelect(Table) { +export default function multiSelect(Table) { Array.prototype.indexOf = function(val) { for (var i = 0; i < this.length; i++) { if (this[i] == val) return i; @@ -90,7 +90,7 @@ module.exports = function multiSelect(Table) { checkedObj: checkedObj, selIds: selIds }); - if(typeof getSelectedDataFunc === 'function'){ + if (typeof getSelectedDataFunc === "function") { getSelectedDataFunc(selIds); } }; @@ -150,4 +150,4 @@ module.exports = function multiSelect(Table) { return ; } }; -}; +} diff --git a/src/lib/sort.js b/src/lib/sort.js index 22b360c..8d7abf1 100644 --- a/src/lib/sort.js +++ b/src/lib/sort.js @@ -3,7 +3,7 @@ import Icon from "bee-icon"; /** * 参数:prefixCls,默认bee-table,用于设置图标的样式 - * @param {*} Table + * @param {*} Table */ export default function sort(Table) { return class Demo11 extends Component { @@ -62,18 +62,18 @@ export default function sort(Table) { sortButton = (
this.toggleSortOrder("ascend", column)} > this.toggleSortOrder("descend", column)} > diff --git a/src/lib/sum.js b/src/lib/sum.js index ba8b21f..7d34ab2 100644 --- a/src/lib/sum.js +++ b/src/lib/sum.js @@ -8,7 +8,7 @@ let columns2 = { dataIndex: "showSum" }; -let sum = Table => { +export default function sum(Table){ return class SumTable extends React.Component { //无状态 constructor(props) { @@ -17,7 +17,7 @@ let sum = Table => { //合计数字列,并将计算所得数据存储到一个obj对象中 currentFooter = () => { let data_2 = this.props.data; - let columns_sum = (this.props.columns).concat(); + let columns_sum = this.props.columns.concat(); let sumCol_index; //用一个对象存储合计数据,这里合计对象的属性对应每列字段 for (let i = 0; i < columns_sum.length; i++) { @@ -66,5 +66,3 @@ let sum = Table => { } }; }; - -export default sum;