Demo.tsx 692 B

123456789101112131415161718192021222324252627282930
  1. import React from 'react';
  2. import Tabs from '../index';
  3. import TabPane from '../TabPane';
  4. const Demo = () => {
  5. const tabPaneList = [
  6. 'a',
  7. 'b',
  8. 'c'
  9. ];
  10. return (
  11. <div>
  12. <Tabs defaultActiveKey="1"
  13. tabPaneMotion>
  14. {
  15. tabPaneList.map((item, index) => {
  16. return (
  17. <TabPane tab={item} itemKey={index.toString()} key={item}>
  18. { item + index }
  19. </TabPane>
  20. )
  21. })
  22. }
  23. </Tabs>
  24. </div>
  25. )
  26. }
  27. export default Demo