index.tsx 937 B

12345678910111213141516171819202122232425262728
  1. import React, { useState } from 'react'
  2. import { Card, Button, Tabs } from 'antd';
  3. import './index.less'
  4. import Ad from './ad';
  5. import Creative from './creative';
  6. import Targeting from './targeting';
  7. const { TabPane } = Tabs;
  8. const tabsConfig = [
  9. // { key: '1', tab: '计划模板',jsx:<Campaign/> },
  10. { key: '1', tab: '广告模板',jsx:<Ad/>},
  11. { key: '2', tab: '创意模板' ,jsx:<Creative/>},
  12. { key: '3', tab: '定向模板' ,jsx:<Targeting/>},
  13. ]
  14. function LocalAd() {
  15. const [activeKey, setActiveKey] = useState('1')
  16. return <Card>
  17. <Tabs activeKey={activeKey} type="card" onChange={(activeKey) => { setActiveKey(activeKey) }} >
  18. {
  19. tabsConfig?.map(item => {
  20. return <TabPane tab={item.tab} key={item.key} >
  21. {item.jsx}
  22. </TabPane>
  23. })
  24. }
  25. </Tabs>
  26. </Card>
  27. }
  28. export default LocalAd