@enum-plus/plugin-antd
Version:
A plugin for enum-plus that provides functionality to bind enums to Ant Design
23 lines (21 loc) • 595 B
JavaScript
// eslint-disable-next-line @typescript-eslint/no-empty-interface
var toMenuPlugin = function toMenuPlugin(options, Enum) {
Enum.extends({
toMenu: function toMenu() {
return Array.from(this.items.map(function (_ref) {
var value = _ref.value,
label = _ref.label;
return {
key: value,
label: label
};
}));
}
});
};
export default toMenuPlugin;
/**
* - **EN:** Data structure of menu items of ant-design Menu component
* - **CN:** ant-design Menu 组件的菜单项数据结构
*/
//# sourceMappingURL=toMenu.js.map