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}