69 lines
1.5 KiB
Vue
Raw Normal View History

2024-12-31 10:58:07 +08:00
<template>
<view class="mx-4 py-1 bg-white rounded-2 pos-relative shadow-sm">
<view
class="h-42px z-10 pos-absolute right-1 bg-white flex flex-items-center justify-center px-2"
>
<image @click="clickMenu" src="/static/images/icon_table_menu.png" class="w-5 h-5"></image>
</view>
2024-12-31 18:53:50 +08:00
<wd-tabs
v-model="tab"
auto-line-width
swipeable
animated
color="#0d100e"
inactiveColor="#838383"
>
<wd-tab v-for="(item, index) in list" :key="index" :title="item.name" :name="index">
<view class="flex flex-wrap ml-1.5">
2024-12-31 10:58:07 +08:00
<view
v-for="subItem in item.list"
:key="subItem.id"
class="text-center my-2 w-20.4375"
2024-12-31 10:58:07 +08:00
@click="clickItem(subItem)"
>
<image :src="subItem.icon" class="w-7 h-7 m-a"></image>
<view class="text-3 mt-2">{{ subItem.name }}</view>
2024-12-31 10:58:07 +08:00
</view>
</view>
</wd-tab>
</wd-tabs>
</view>
</template>
<script setup lang="ts">
2025-01-07 16:56:58 +08:00
import { HomeTab, HomeTabItem } from '@/typings'
2024-12-31 18:53:50 +08:00
defineOptions({
options: {
styleIsolation: 'shared'
}
})
2024-12-31 10:58:07 +08:00
const tab = ref<number>(0)
2025-01-02 16:11:01 +08:00
defineProps({
2024-12-31 10:58:07 +08:00
list: {
type: Array<HomeTab>,
required: true
}
})
2024-12-31 18:53:50 +08:00
const clickMenu = () => {
uni.navigateTo({
url: '/pages/application-list/application-list'
})
}
2024-12-31 10:58:07 +08:00
const clickItem = (item: HomeTabItem) => {
2025-01-07 16:56:58 +08:00
uni.navigateTo({
url: item.url
})
2024-12-31 10:58:07 +08:00
}
</script>
2024-12-31 18:53:50 +08:00
<style>
:deep(.wd-tabs__nav--wrap) {
margin-right: 30px;
}
</style>