linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
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
<template>
    <view class="menu-box" @click="curMenuClick(curMenu)">
        <view v-if="imgShow">
            <u--image :src="curMenu.imgUrl" :width='curMenu.imgWidth || 40' :height='curMenu.imgHeight || 40'
                shape="circle"></u--image>
        </view>
        <view v-if="textShow" :style="{height: curMenu.numHeight ? curMenu.numHeight + 'px' : '56rpx'}">
            {{curMenu.num}}
        </view>
        <view :style="{height: curMenu.titleHeight ? curMenu.titleHeight + 'px' : '56rpx'}">
            {{curMenu.title}}
        </view>
    </view>
</template>
 
<script>
    export default {
        props: {
            curMenu: {
                type: Object,
                default: () => {
                    return {}
                }
            },
 
            imgShow: {
                type: Boolean,
                default: true
            },
 
            textShow: {
                type: Boolean,
                default: false
            },
        },
 
        methods: {
            curMenuClick(e) {
                console.log('当前点击处')
 
                if (e.event) {
                    e.event(e)
                }
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .menu-box {
        display: flex;
        flex-direction: column;
        font-size: 28rpx;
 
        &>view {
            display: flex;
            justify-content: center;
            align-items: center;
        }
 
        &>view:first-child {
            flex: 1;
        }
    }
</style>