simple.tsx 659 B

12345678910111213141516171819202122232425262728
  1. import 'babel-polyfill';
  2. import React from 'react';
  3. import ReactDOM from 'react-dom';
  4. import styled from 'styled-components';
  5. import { PhotoView } from '../src';
  6. const Container = styled.div`
  7. font-size: 32px;
  8. `;
  9. const Header = styled.header`
  10. padding: 40px;
  11. font-size: 32px;
  12. border-bottom: 1px solid #ccc;
  13. `;
  14. class Example extends React.Component {
  15. render() {
  16. return (
  17. <Container>
  18. <Header>React 图片预览组件</Header>
  19. <PhotoView src="https://assets-cdn.github.com/images/modules/explore/resources/campus_experts.png" />
  20. </Container>
  21. );
  22. }
  23. }
  24. ReactDOM.render(<Example />, document.getElementById('root'));