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

Method formatOptions

src/cascader/Menu.jsx:89–100  ·  view source on GitHub ↗
(options: any)

Source from the content-addressed store, hash-verified

87 const activeValue = this.state.activeValue;
88 const configurableProps = ['label', 'value', 'children', 'disabled'];
89 const formatOptions = (options: any) => {
90 options.forEach(option => {
91 if (option.__IS__FLAT__OPTIONS) return;
92 configurableProps.forEach(prop => {
93 const value = option[this.parent().props.props[prop] || prop];
94 if (value) option[prop] = value;
95 });
96 if (Array.isArray(option.children)) {
97 formatOptions(option.children);
98 }
99 });
100 };
101 const loadActiveOptions = (options: any, activeOptions: any = []): [] => {
102 const level = activeOptions.length;
103 activeOptions[level] = options;

Callers

nothing calls this directly

Calls 1

parentMethod · 0.95

Tested by

no test coverage detected