<template>
<div class="card-wrapper">
  <div class="card-title" :style="`color:${color}`">
    <div class="dot"/>
    {{title}}
    <div class="line">
      <img src="@/assets/images/card-title-line.png"/>
    </div>
    <p v-if="showTip" class="tip">数值为报修数量/占比/密度</p>
  </div>
  <div class="card-content">
    <slot />
  </div>
</div>
</template>

<script>
export default {
  name: 'Mode2',
  props: {
    title: {
      type: String,
      default: '标题',
    },
    showTip: {
      type: Boolean,
      default: false,
    },
    color: {
      type: String,
    }
  },
}
</script>

<style lang="stylus" scoped>
.card-wrapper
  .card-title
    display flex
    align-items center
    font-size .11rem
    font-weight bold
    position relative
    .tip
      position absolute
      right 0
      font-weight normal
      font-size .08rem
    .dot
      width .03rem
      height .1rem
      background $edgeColor
      margin-right .05rem
    .line
      margin-left .05rem
      flex 1
      >img
        width 100%
        min-height .05rem
  .card-content
    padding 0.03rem 0 0
    >div
      width 100%
      height 100%
</style>
