<route lang="json5">
{
  style: {
    navigationStyle: 'custom',
    disableScroll: true
  }
}
</route>
<template>
  <view>
    <TopNavigation :title="index === 0 ? '发起申请' : '审批'"></TopNavigation>
    <CustomTabBar :list="list" :default-index="index" @change="change"></CustomTabBar>
  </view>
</template>

<script setup lang="ts">
  import { TabBarItem } from '@/typings'

  const index = ref<number>(0)

  const list: Array<TabBarItem> = [
    {
      title: '新申请',
      icon: 'home'
    },
    {
      title: '审批中心',
      icon: 'home'
    }
  ]

  onLoad(options => {
    if (options.index) {
      index.value = Number(options.index)
    }
  })

  const change = (data: object) => {
    index.value = data.value
  }
</script>
