simple.tsx 551 B

1234567891011121314151617181920212223242526272829303132
  1. import 'babel-polyfill';
  2. import React from 'react';
  3. import ReactDOM from 'react-dom';
  4. import styled from 'styled-components';
  5. const Container = styled.div`
  6. padding: 0.4rem 0;
  7. font-size: 0.32rem;
  8. `;
  9. const Header = styled.header`
  10. padding: 0.2rem;
  11. font-size: 0.35rem;
  12. border-bottom: 1px solid #CCC;
  13. `;
  14. class Example extends React.Component {
  15. render() {
  16. return (
  17. <Container>
  18. <Header>React 图片预览组件</Header>
  19. </Container>
  20. );
  21. }
  22. }
  23. ReactDOM.render(
  24. <Example />,
  25. document.getElementById('root'),
  26. );