如何只触发一行

时间:2017-10-27 19:14:34

标签: css list reactjs hover material-ui

我有一个组件如何工作;当我将鼠标悬停在列表对象上时,无论如何它都在工作

import React from 'react';

const ExampleComponent = ({show}) => {
  const componentClasses = ['example-component'];
  if (show) { componentClasses.push('show'); }

  return (
    <div className={componentClasses.join(' ')}></div>
  );
};

ExampleComponent.propTypes = {
  show: React.PropTypes.bool.isRequired
};

export default ExampleComponent;

我正在使用这样的;

 import SubButtons from './subButtons';

 return shownAccountList.map((item) => {
  return(
    <List>
      <ListItem
        primaryText={text={ item.accountItem }}
      />
      <SubButtons show={this.state.subButtonsVisible}/>
    </List>
  );

结果:enter image description here

预期结果;我只想触发我带给鼠标的元素 例如,如果我选择第1行应该在唯一的第1行

下工作 是的:我正在使用material-ui。如果您有其他推荐,我会接受。

0 个答案:

没有答案
相关问题