From 835b37ff9f8a1d7a10529c09ede0dbe27faf1445 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Thu, 20 Jul 2017 09:59:44 +0800 Subject: [PATCH] fixed #1403 --- examples/routers/table.vue | 33 +++++++++++++++++---------------- src/components/table/table.vue | 4 ++++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/examples/routers/table.vue b/examples/routers/table.vue index c5bc28e..376858f 100644 --- a/examples/routers/table.vue +++ b/examples/routers/table.vue @@ -46,6 +46,7 @@ title: '年龄', key: 'age', sortable: true, +// sortType: 'asc', width: 200 }, { @@ -81,22 +82,22 @@ // } ], data3: [ -// { -// name: '王小明', -// age: 18, -// address: '北京市朝阳区芍药居', -// province: '北京市', -// city: '朝阳区', -// zip: 100000 -// }, -// { -// name: '张小刚', -// age: 25, -// address: '北京市海淀区西二旗', -// province: '北京市', -// city: '海淀区', -// zip: 100000 -// }, + { + name: '王小明', + age: 18, + address: '北京市朝阳区芍药居', + province: '北京市', + city: '朝阳区', + zip: 100000 + }, + { + name: '张小刚', + age: 25, + address: '北京市海淀区西二旗', + province: '北京市', + city: '海淀区', + zip: 100000 + }, // { // name: '李小红', // age: 30, diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 5d06866..b4b1de4 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -660,6 +660,10 @@ column._isFiltered = true; } + if ('sortType' in column) { + column._sortType = column.sortType; + } + if (column.fixed && column.fixed === 'left') { left.push(column); } else if (column.fixed && column.fixed === 'right') { -- libgit2 0.21.4