From 38cbaf1239b2eb8cdcc1aabbef5bdb21f558fe70 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 26 Aug 2015 14:08:46 +0800 Subject: [PATCH] dataSource clone config should not be overwrited by origin config, fix #200 --- components/table/demo/ajax.md | 1 + components/table/index.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/table/demo/ajax.md b/components/table/demo/ajax.md index a32adb0d2b..157eb3a7d8 100644 --- a/components/table/demo/ajax.md +++ b/components/table/demo/ajax.md @@ -35,6 +35,7 @@ var dataSource = new Table.DataSource({ resolve: function(result) { return result.data; }, + data: {}, // 和后台接口返回的分页数据进行适配 getPagination: function(result) { return { diff --git a/components/table/index.jsx b/components/table/index.jsx index e3f083947e..2bf60bba8b 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -31,7 +31,7 @@ class DataSource { } clone(config = {}) { - return new DataSource(objectAssign(config, this.config)); + return new DataSource(objectAssign({}, this.config, config)); } }