UNPKG

zent

Version:

一套前端设计语言和基于React的实现

16 lines (15 loc) 705 B
import { __assign, __extends } from "tslib"; import { cloneElement, PureComponent } from 'react'; import { getKeyFromChildrenIndex } from './utils'; var CommonMenu = (function (_super) { __extends(CommonMenu, _super); function CommonMenu() { return _super !== null && _super.apply(this, arguments) || this; } CommonMenu.prototype.renderCommonMenuItem = function (component, index, subPrefix, extraProps) { var newChildProps = __assign({ specKey: getKeyFromChildrenIndex(component, index, subPrefix), onClick: this.handleClick }, extraProps); return cloneElement(component, newChildProps); }; return CommonMenu; }(PureComponent)); export default CommonMenu;