shuishen
2023-10-30 d5fac02a6fdc6564ff5da88056245d0fa579f3c6
components/curMenu/index.vue
@@ -1,15 +1,16 @@
<template>
      <view class="menu-box" @click="curMenuClick(curMenu)">
         <view v-if="imgShow">
            <u--image :src="curMenu.imgUrl" :width='curMenu.imgWidth || 54' :height='curMenu.imgHeight || 54' 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 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>
@@ -21,22 +22,22 @@
               return {}
            }
         },
         imgShow: {
            type: Boolean,
            default: true
         },
         textShow: {
            type: Boolean,
            default: false
         },
      },
      methods: {
         curMenuClick(e) {
            console.log('当前点击处')
            if (e.event) {
               e.event(e)
            }
@@ -50,16 +51,15 @@
      display: flex;
      flex-direction: column;
      font-size: 28rpx;
      & > view {
      &>view {
         display: flex;
         justify-content: center;
         align-items: center;
      }
      & > view:first-child {
      &>view:first-child {
         flex: 1;
      }
   }
</style>