TableCell.tsx 855 B

1234567891011121314151617181920212223242526272829
  1. import { View, Text, Image } from "@tarojs/components";
  2. import './TableCell.scss'
  3. export default function Component(props: {
  4. children?: React.ReactNode,
  5. title: string,
  6. showArrow?: boolean,
  7. showMarginBottom?: boolean,
  8. onClick?: Function
  9. }) {
  10. function onClick() {
  11. if (props.onClick) {
  12. props.onClick()
  13. }
  14. }
  15. return <View onClick={onClick} className={props.showMarginBottom ? "table_cell table_cell_margin_bottom" : "table_cell"}>
  16. <View style={{ flex: 1,display:'flex',flexDirection:'row',alignItems:'center' }}>
  17. <Text className='table_cell_title'>{props.title}</Text>
  18. </View>
  19. {
  20. props.children
  21. }
  22. {
  23. props.showArrow && <Image src={require('@assets/images/arrow3.png')} className="table_cell_arrow" />
  24. }
  25. </View>
  26. }