index.jsx 625B

1234567891011121314151617181920212223
  1. import React from 'react';
  2. import { Typography } from 'antd';
  3. import useRoute from '@/routes/hooks/useRoute';
  4. const pageStyle = {
  5. margin: '0 24px 24px 24px',
  6. // margin: '24px',
  7. minHeight: 'calc(100% - 24px)',
  8. }
  9. const { Title } = Typography;
  10. export default (props) => {
  11. const { meta = {} } = useRoute() || {};
  12. const style = meta.noLayout ? { height: '100%' } : pageStyle;
  13. const title = props.title || meta.title;
  14. return (
  15. <div style={style}>
  16. { title && !meta.noLayout && <Title level={3} style={{ paddingBottom: '12px', fontWeight: 400 }}>{ title }</Title> }
  17. {props.children}
  18. </div>
  19. )
  20. }