From e253329a67ed7184facb8fb101091e060ec2842e Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 20 Jan 2021 21:16:10 +0800 Subject: [PATCH] chore(TreeSelect): onSidebarChange --- src/tree-select/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tree-select/index.js b/src/tree-select/index.js index 1c304cfbe..a0d5c7e25 100644 --- a/src/tree-select/index.js +++ b/src/tree-select/index.js @@ -97,14 +97,19 @@ export default createComponent({ ); }; + const onSidebarChange = (index) => { + emit('update:mainActiveIndex', index); + emit('click-nav', index); + }; + const renderSidebar = () => { const Items = props.items.map((item) => ( )); @@ -112,10 +117,7 @@ export default createComponent({ { - emit('update:mainActiveIndex', index); - emit('click-nav', index); - }} + onChange={onSidebarChange} > {Items}