mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(TreeSelect): add deprecation warning of navclick/itemclick (#7351)
This commit is contained in:
parent
3fc2af9842
commit
3fe485c959
@ -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<TreeSelectItem> = items[+mainActiveIndex] || {};
|
||||
const subItems = selectedItem.children || [];
|
||||
const isMultiple = Array.isArray(activeId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user