不起作用 https://stackblitz.com/edit/react-cng5am?file=demo.js
工作演示 https://codesandbox.io/s/qvyvxq7zy6
import DoneIcon from '@material-ui/icons/Done';
<Chip
style={{ display: this.state.display ? "" : "none" }}
label={this.state.chipName}
onDelete={this.handleDelete}
color="primary"
deleteIcon={<DoneIcon />}
/>
<chip
style={{ display: this.state.display ? "none" : "" }}
// aria-owns={anchorEl ? 'simple-menu' : undefined}
// aria-haspopup="true"
onClick={this.handleClickOpen}
color="primary"
deleteIcon={<DoneIcon />}
>
Open Menu
</chip>
答案 0 :(得分:1)
尝试添加道具onDelete={() => {}}
。检查以下示例:
<Chip
style={{ display: this.state.display ? "" : "none" }}
label={this.state.chipName}
onDelete={this.handleDelete}
color="primary"
deleteIcon={<DoneIcon />}
onDelete={() => {}}
/>