Newer
Older
smartKitchenFront / src / components / mycomponent / DataInfoItem.vue
<!--数据指标卡-->
<template>
  <div class="data_container">
     <div class="data_Img">
        <img  class="bgimg" src="@/assets/kitchen/数据框.png" alt="">
        <img class="img" :src="img">
     </div>
     <div class="data_Info">
        <div class="title">{{title}}</div>
        <div><span class="number">{{number}}</span><span class="unit">{{unit}}</span></div>
     </div>
  </div>
</template>

<script>
export default {
 props:['img','title','number','unit']
}
</script>

<style lang="scss" scoped>
 .data_container{
    height: 94px;
    width: 300px;
    overflow: hidden;
    display: flex;
    background-color: rgba(36, 131, 179, 0.2);
    border: 1px solid #2483b3;
    border-radius: 20px;
    justify-content: space-evenly;
    align-items: center;
    .data_Img{
        position: relative;
        width: 80px;
        height: 80px;
        .bgimg{
            position: absolute;
            z-index: 1;
        }
        .img{
            position: absolute;
            z-index: 2;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            height: 50px;
            width:  50px;
        }
    }
    .data_Info{
        color:  rgb(40, 115, 158);
        display: flex;
        flex-direction: column;
        align-items: center;
        .title{
            font-size: 16px;
            font-weight: 600;
        }
        .number{
            font-size: 40px;
            line-height: 40px;
        }
        .unit{
            font-size: 16px;
            margin-left: 5px;
        }
    }
 }
</style>