index.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Tab, Tabs } from 'vant'
  2. import { defineComponent, reactive } from 'vue'
  3. import Range from './component/range'
  4. import SiginInRule from './component/sigin-in-rule'
  5. import SiginOutRule from './component/sigin-out-rule'
  6. import styles from './index.module.less'
  7. export default defineComponent({
  8. name: 'attendance-rules',
  9. setup() {
  10. const forms = reactive({
  11. tabValue: 'range'
  12. })
  13. return () => (
  14. <div class={styles.attendanceRules}>
  15. <Tabs
  16. sticky
  17. lineWidth={20}
  18. lineHeight={4}
  19. swipeable
  20. animated
  21. v-model:active={forms.tabValue}
  22. >
  23. <Tab title="考勤范围" name="range">
  24. {forms.tabValue === 'range' && <Range />}
  25. </Tab>
  26. <Tab title="签到规则" name="signin-rule">
  27. {forms.tabValue === 'signin-rule' && <SiginInRule />}
  28. </Tab>
  29. <Tab title="签退规则" name="signout-rule">
  30. {forms.tabValue === 'signout-rule' && <SiginOutRule />}
  31. </Tab>
  32. </Tabs>
  33. </div>
  34. )
  35. }
  36. })