单击菜单项时切换事件(反应)

时间:2018-10-23 14:04:41

标签: reactjs

当我选择其中之一时,我正在尝试更改菜单中的选定属性。该方法如何切换? (React.js)

<NavigationButton to="/" label="Dashboard" exact>
  <MenuItem className={classes.menuItem} selected={true}>
    <ListItemIcon className={classes.icon}>
      <Home />
    </ListItemIcon>
    <ListItemText classes={{primary: classes.primary}} inset primary="text1" />
  </MenuItem>
</NavigationButton>
<NavigationButton to="/payment" label="Payment" exact>
  <MenuItem className={classes.menuItem}>
    <ListItemIcon className={classes.icon}>
      <Payment />
    </ListItemIcon>
    <ListItemText classes={{primary: classes.primary}} inset primary="text2" />
  </MenuItem>
</NavigationButton>

0 个答案:

没有答案