import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { Link } from 'dva/router'; import { Button, Icon } from 'antd'; import styles from './index.less'; // TODO: 添加逻辑 class EditableLinkGroup extends PureComponent { static defaultProps = { links: [], onAdd: () => { }, } state = { links: this.props.links, }; handleOnClick() { const { onAdd } = this.props; onAdd(); } render() { const { links } = this.state; return (
{ links.map(link => {link.title}) } { }
); } } EditableLinkGroup.propTypes = { links: PropTypes.array, onAdd: PropTypes.func, }; export default EditableLinkGroup;