SectionItem.vue
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
<view class="flex items-center justify-between px-[40rpx] mt-[56rpx] cursor-pointer" @tap="handleClick">
<view class="flex items-center">
<view class="w-[96rpx] h-[96rpx] mr-[32rpx] flex items-center justify-center bg-gray-50 rounded-full">
<IconFont :name="icon" class="text-blue-600" size="32" />
</view>
<view class="flex flex-col">
<text class="text-[#1f2937] text-[28rpx] font-normal leading-[40rpx]">{{ title }}</text>
<text class="text-[#6b7280] text-[24rpx] mt-[8rpx] leading-[32rpx]">{{ subtitle }}</text>
</view>
</view>
<IconFont name="RectRight" class="text-gray-400" size="16" />
</view>
</template>
<script setup>
import IconFont from './IconFont.vue'
/**
* Section Item Component
* @description 单个展示项目组件,包含图标、标题、副标题和右侧箭头
*/
defineProps({
/**
* 图标名称(对应 IconFont 组件的 name)
* @example 'Edit', 'Check', 'Order'
*/
icon: {
type: String,
required: true
},
/**
* 标题
*/
title: {
type: String,
required: true
},
/**
* 副标题/描述
*/
subtitle: {
type: String,
default: ''
},
/**
* 路由路径(可选,用于跳转)
*/
route: {
type: String,
default: ''
}
})
const emit = defineEmits(['click'])
/**
* 处理点击事件
*/
const handleClick = () => {
emit('click')
}
</script>
<script>
export default {
name: 'SectionItem'
}
</script>