List.jsx 805 B

123456789101112131415161718192021222324252627282930313233
  1. import React, { Component } from 'react'
  2. import { List } from 'antd-mobile';
  3. const Item = List.Item;
  4. export default class Lists extends Component {
  5. render() {
  6. return (
  7. <List >
  8. {
  9. this.props.icon ?
  10. <Item
  11. extra={this.props.extra}
  12. thumb={this.props.icon}
  13. arrow="horizontal"
  14. onClick={() => {this.props.callback()}}
  15. ><span className="listText">{this.props.text}</span></Item>
  16. :
  17. <Item
  18. extra={this.props.extra}
  19. arrow="horizontal"
  20. onClick={() => {this.props.callback()}}
  21. ><span className="listText">{this.props.text}</span></Item>
  22. }
  23. </List>
  24. )
  25. }
  26. }