index.js 574 B

12345678910111213141516171819202122232425
  1. import { UnityAction } from '@/utils/utils';
  2. import { CloseOutlined } from '@ant-design/icons';
  3. import styles from './index.less';
  4. export default (props) => {
  5. const { children, style, closeable = true, tabs = false } = props;
  6. const handleClose = () => {
  7. UnityAction.sendMsg('closePage');
  8. };
  9. return (
  10. <div className={styles.page} style={style}>
  11. {closeable && (
  12. <CloseOutlined
  13. onClick={handleClose}
  14. className={styles.close}
  15. style={{ top: tabs ? 65 : '' }}
  16. />
  17. )}
  18. {children}
  19. </div>
  20. );
  21. };