index.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { Tabs, Tab } from 'vant'
  2. import { defineComponent, reactive, ref } from 'vue'
  3. import styles from './index.module.less'
  4. import { useRouter } from 'vue-router'
  5. import MyApproval from './MyApproval'
  6. import Agency from './agency'
  7. import OSticky from '@/components/o-sticky'
  8. import OHeader from '@/components/o-header'
  9. const activeName = ref('wait')
  10. export default defineComponent({
  11. name: 'approval-manage',
  12. setup() {
  13. const router = useRouter()
  14. const state = reactive({})
  15. const headerHeight = ref(0)
  16. return () => (
  17. <div>
  18. <OSticky
  19. onGetHeight={(height: number) => {
  20. headerHeight.value = height
  21. document.documentElement.style.setProperty('--header-height', height + 'px')
  22. }}
  23. >
  24. <OHeader />
  25. </OSticky>
  26. <Tabs
  27. v-model:active={activeName.value}
  28. class={styles.approvalTab}
  29. animated
  30. sticky
  31. offsetTop={headerHeight.value}
  32. swipeable
  33. >
  34. <Tab name="wait" title="处理事项">
  35. <Agency />
  36. </Tab>
  37. <Tab name="end" title="我的审批">
  38. <MyApproval />
  39. </Tab>
  40. </Tabs>
  41. </div>
  42. )
  43. }
  44. })