orchestra-detail.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import OHeader from '@/components/o-header'
  2. import OSticky from '@/components/o-sticky'
  3. import { Sticky, Tab, Tabs } from 'vant'
  4. import { defineComponent, ref } from 'vue'
  5. import Information from './compontent/information'
  6. import Photo from './compontent/photo'
  7. import Plan from './compontent/plan'
  8. import styles from './orchestra-detail.module.less'
  9. export default defineComponent({
  10. name: 'orchestra-detail',
  11. setup() {
  12. const tabs = sessionStorage.getItem('orchestra-detail-tab')
  13. console.log(tabs, 'tabs')
  14. const tabValue = ref(tabs || 'information')
  15. sessionStorage.removeItem('orchestra-detail-tab')
  16. return () => (
  17. <div class={styles.orchestraDetail}>
  18. <OSticky position="top">
  19. <OHeader />
  20. <Tabs sticky lineWidth={20} lineHeight={4} v-model:active={tabValue.value}>
  21. <Tab title="乐团信息" name="information"></Tab>
  22. <Tab title="训练进度" name="plan"></Tab>
  23. <Tab title="训练照片" name="photo"></Tab>
  24. {/* <Tab title="乐团资讯" name="info"></Tab> */}
  25. </Tabs>
  26. </OSticky>
  27. {tabValue.value === 'information' && <Information />}
  28. {tabValue.value === 'plan' && <Plan />}
  29. {tabValue.value === 'photo' && <Photo />}
  30. </div>
  31. )
  32. }
  33. })