From 9892db0ee9beaf2f7e100dbfa9b0878c0ce4c46a Mon Sep 17 00:00:00 2001 From: elf-mouse Date: Wed, 15 Feb 2023 16:40:52 +0800 Subject: [PATCH] feat: add sorted prop (#160) --- src/scripts/components/table/constants.js | 3 ++- src/scripts/components/table/table.vue | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scripts/components/table/constants.js b/src/scripts/components/table/constants.js index 6c2ba40ae..4048d34e5 100644 --- a/src/scripts/components/table/constants.js +++ b/src/scripts/components/table/constants.js @@ -40,7 +40,8 @@ export default { MIN: 'min' }, EVENT: { - SELECTED: 'selected' + SELECTED: 'selected', + SORTED: 'sorted' }, CHECKBOX_COL_WIDTH: 50 // px }; diff --git a/src/scripts/components/table/table.vue b/src/scripts/components/table/table.vue index 4fb303548..68302f876 100644 --- a/src/scripts/components/table/table.vue +++ b/src/scripts/components/table/table.vue @@ -454,6 +454,8 @@ export default { this.$table.listen(events.SORTED, ({ detail }) => { // TODO: multi-row header is unsupported this.handleSort(detail); + + this.$emit(UI_TABLE.EVENT.SORTED, detail); }); if (this.selectedRows.length) {