Newer
Older
CloudBrainNew / src / components / text / Text1.vue
StephanieGitHub on 4 Feb 2021 1 KB first commit
<!--
 * @Description: 文本1, 两个值的
 * @Author: 王晓颖
 * @Date: 2020-08-12 09:32:56
 -->
<template>
  <div class="info-box">
    <div>
      <span>{{titles.name}}:{{data[options.name]}}</span>
    </div>
    <div>
      <span>{{titles.num}}:<b :style="'color:'+options.color">{{data[options.num]}}</b>{{options.unit}}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Text1',
  props: {
    titles: {
      type: Object,
      default: () => {
        return {
          name: '名称',
          num: '数量'
        }
      }
    }, // 标题
    options: {
      type: Object,
      default: () => {
        return {
          color: 'red',
          name: 'name',
          num: 'num',
          unit: '个'
        }
      }
    }, // 胚子
    data: {
      type: Object,
      required: true
    } // 数据
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  @import '../../assets/css/variable.scss';
  .info-box{
    flex:1;
    div{
      overflow: hidden;
      height: .12rem;
    }
    span{
      font-size: .04rem;
      color:$blockTextColor;
      -webkit-transform-origin-x: 0;
      transform:  scale(0.5833333333333334);
      -webkit-transform: scale(.5);
      b{
        font-weight: bold;
        font-size: .07rem
      }
    }
  }
</style>