FundTabbar.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view class="fund-tabbar-placeholder">
  3. <uv-tabbar
  4. :value="active"
  5. @change="onChange"
  6. :fixed="true"
  7. :placeholder="true"
  8. :safeAreaInsetBottom="true"
  9. activeColor="#1c9bfd"
  10. inactiveColor="#999"
  11. >
  12. <uv-tabbar-item text="报销提醒" icon="info-circle"></uv-tabbar-item>
  13. <uv-tabbar-item text="经费报销" icon="order"></uv-tabbar-item>
  14. </uv-tabbar>
  15. </view>
  16. </template>
  17. <script setup lang="ts">
  18. import { ref, watch, onMounted } from 'vue';
  19. import { onRouterPush } from '@/utils/router';
  20. const props = defineProps({
  21. current: {
  22. type: Number,
  23. default: 0
  24. }
  25. });
  26. const active = ref(props.current);
  27. const onChange = (index: number) => {
  28. if (index === active.value) return;
  29. if (index === 0) {
  30. onRouterPush('/pages/fund/reimbursement-remind/index');
  31. } else {
  32. onRouterPush('/pages/fund/reimbursement/index');
  33. }
  34. };
  35. onMounted(() => {
  36. active.value = props.current;
  37. });
  38. watch(() => props.current, (val) => {
  39. active.value = val;
  40. });
  41. </script>
  42. <style lang="scss" scoped>
  43. /* UV-Tabbar placeholder handles spacing */
  44. </style>