diff --git a/src/tree-select/index.tsx b/src/tree-select/index.tsx index 6c1685a67..b558d5cfc 100644 --- a/src/tree-select/index.tsx +++ b/src/tree-select/index.tsx @@ -52,6 +52,19 @@ function TreeSelect( ) { const { items, height, activeId, selectedIcon, mainActiveIndex } = props; + if (process.env.NODE_ENV !== 'production') { + if (ctx.listeners.navclick) { + console.warn( + '[Vant] TreeSelect: "navclick" event is deprecated, use "click-nav" instead.' + ); + } + if (ctx.listeners.itemclick) { + console.warn( + '[Vant] TreeSelect: "itemclick" event is deprecated, use "click-item" instead.' + ); + } + } + const selectedItem: Partial = items[+mainActiveIndex] || {}; const subItems = selectedItem.children || []; const isMultiple = Array.isArray(activeId);