Container.jsx 431B

1234567891011121314151617181920
  1. import React from 'react';
  2. import { Outlet } from 'react-router-dom';
  3. import useRoute from '@/utils/hooks/useRoute';
  4. const containerStyle = {
  5. margin: '24px 24px 0 24px',
  6. height: '100%',
  7. }
  8. export default (props) => {
  9. const currentRoute = useRoute();
  10. const style = currentRoute.meta && currentRoute.meta.noLayout ? { height: '100%' } : containerStyle;
  11. return (
  12. <div style={style}>
  13. <Outlet />
  14. </div>
  15. )
  16. }