<template>
  <div class="rt-statistic">
    <div class="rt-statistic-title" v-if="titlePosition==='top'">{{title}}</div>
    <div class="rt-statistic-content">
      <span class="rt-statistic-text">{{value}}</span>
      <span class="rt-statistic-suffix">{{suffix}}</span>
    </div>
    <div class="rt-statistic-title" v-if="titlePosition==='bottom'">{{title}}</div>
  </div>
</template>

<script>
export default {
  name: 'RtStatistic',
  props: {
    title: String,
    value: [String, Number],
    suffix: String,
    titlePosition: {
      type: String,
      default: 'top'
    }
  }
};
</script>

<style lang="less">
.rt-statistic {
  padding: 5px 0;
  width: 100%;
  text-align: center;
  .rt-statistic-title {
    color: #555555;
    font-size: 11px;
  }
  span.rt-statistic-text {
    color: #ffa424;
    font-size: 18px;
    font-weight: 600;
  }
  span.rt-statistic-suffix {
    color: #555555;
    font-size: 11px;
  }
}
</style>
