MCPcopy Create free account
hub / github.com/ElemeFE/element-react / activeItem

Method activeItem

src/cascader/Menu.jsx:70–82  ·  view source on GitHub ↗
(item: any, menuIndex: number)

Source from the content-addressed store, hash-verified

68 }
69
70 activeItem(item: any, menuIndex: number) {
71 const activeOptions = this.activeOptions();
72
73 this.state.activeValue.splice(menuIndex, activeOptions.length, item.value);
74
75 this.forceUpdate();
76
77 if (this.parent().props.changeOnSelect) {
78 this.parent().handlePick(this.state.activeValue, false);
79 } else {
80 this.parent().handleActiveItemChange(this.state.activeValue);
81 }
82 }
83
84 /* Computed Methods */
85

Callers 1

renderMethod · 0.95

Calls 4

activeOptionsMethod · 0.95
parentMethod · 0.95
handlePickMethod · 0.80

Tested by

no test coverage detected