From f6bab114e3f8126a942938cf59d1afe5b09d9337 Mon Sep 17 00:00:00 2001 From: hetech Date: Thu, 30 May 2019 19:33:30 +0800 Subject: [PATCH 01/13] Table: add new features for Table and optimize code (#15709) --- examples/docs/en-US/table.md | 42 +- examples/docs/es/table.md | 38 +- examples/docs/fr-FR/table.md | 46 +- examples/docs/zh-CN/table.md | 45 +- packages/table/src/config.js | 123 +++++ packages/table/src/filter-panel.vue | 11 - packages/table/src/store/current.js | 45 ++ packages/table/src/store/expand.js | 65 +++ packages/table/src/store/helper.js | 37 ++ packages/table/src/store/index.js | 155 ++++++ packages/table/src/store/tree.js | 193 +++++++ packages/table/src/store/watcher.js | 388 ++++++++++++++ packages/table/src/table-body.js | 387 +++++++------- packages/table/src/table-column.js | 570 ++++++++------------- packages/table/src/table-footer.js | 66 +-- packages/table/src/table-header.js | 123 ++--- packages/table/src/table-layout.js | 53 +- packages/table/src/table-store.js | 753 ---------------------------- packages/table/src/table.vue | 224 +++------ packages/table/src/util.js | 132 +++++ packages/theme-chalk/src/table.scss | 8 +- test/unit/specs/table.spec.js | 286 +++++++---- 22 files changed, 2026 insertions(+), 1764 deletions(-) create mode 100644 packages/table/src/config.js create mode 100644 packages/table/src/store/current.js create mode 100644 packages/table/src/store/expand.js create mode 100644 packages/table/src/store/helper.js create mode 100644 packages/table/src/store/index.js create mode 100644 packages/table/src/store/tree.js create mode 100644 packages/table/src/store/watcher.js delete mode 100644 packages/table/src/table-store.js diff --git a/examples/docs/en-US/table.md b/examples/docs/en-US/table.md index 52573628b53..8d1c42e5a62 100644 --- a/examples/docs/en-US/table.md +++ b/examples/docs/en-US/table.md @@ -1332,7 +1332,7 @@ When the row content is too long and you do not want to display the horizontal s ### Tree data and lazy mode -:::demo You can display tree structure data. When using it, the prop `row-key` is required. Also, child row data can be loaded asynchronously. Set `lazy` property of Table to true and the function `load`. Specify `hasChildren` attribute in row to determine which row contains children. +:::demo You can display tree structure data. When row contains the `children` field, it is treated as nested data. For rendering nested data, the prop `row-key` is required。Also, child row data can be loaded asynchronously. Set `lazy` property of Table to true and the function `load`. Specify `hasChildren` attribute in row to determine which row contains children. Both `children` and `hasChildren` can be configured via `tree-props`. ```html