<template>
  <div>
    <template v-for="attr in data.attrs" :key="attr.field">
      <div class="attr"  v-if="!attrField || attrField == attr.field">
        {{attr.name}}{{data[attr.field] || 0}}
      </div>
    </template>
  </div>
</template>

<script setup>
let props = defineProps({
  data:{type:Object,require: true},
  attrField:{type:String,require: true},
})
</script>

<style lang="scss" scoped>
  .attr{
    background-color: #FFFFFF50;
    color: #0E3836;
    font-weight: 600;
    height: 29px;
    border-radius: 10px;
    line-height: 19px;
    text-align: right;
    margin: 5px 5px 0px 0px;
    padding: 5px;
    box-sizing: border-box;
  }
</style>
