1
0

index.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import React, { Component } from 'react';
  2. import './index.less';
  3. import RadioItem from '../RadioItem';
  4. export default class Answer extends Component {
  5. render() {
  6. return <div className="answer">{this.renderTable()}</div>;
  7. }
  8. renderList() {
  9. const { list = [] } = this.props;
  10. return (
  11. <div className="list">
  12. {list.map(item => {
  13. return (
  14. <div className="item">
  15. <RadioItem checked onClick={() => {}} />
  16. <div className="text">{item}</div>
  17. </div>
  18. );
  19. })}
  20. </div>
  21. );
  22. }
  23. renderTable() {
  24. const { list = [] } = this.props;
  25. return (
  26. <table border="1" bordercolor="#d8d8d8">
  27. <thead>
  28. <tr className="bg">
  29. <th align="center" width="100" className="t-c">
  30. Both acce
  31. </th>
  32. <th align="center" width="100" className="t-c">
  33. Otherwise
  34. </th>
  35. <th />
  36. </tr>
  37. </thead>
  38. <tbody>
  39. {list.map(item => {
  40. return (
  41. <tr>
  42. <td align="center" className="bg">
  43. <RadioItem checked onClick={() => {}} />
  44. </td>
  45. <td align="center" className="bg">
  46. <RadioItem checked onClick={() => {}} />
  47. </td>
  48. <td>{item}</td>
  49. </tr>
  50. );
  51. })}
  52. </tbody>
  53. </table>
  54. );
  55. }
  56. }