all files / src/card/ cardHeader.vue

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63                                                                                                                             
<template>
<div class="mu-card-header">
  <slot name="avatar"></slot>
  <div class="mu-card-header-title" v-if="title || subTitle">
    <div class="mu-card-title" :class="titleClass">
      {{title}}
    </div>
    <div class="mu-card-sub-title" :class="subTitleClass">
      {{subTitle}}
    </div>
  </div>
  <slot></slot>
</div>
</template>
 
<script>
export default {
  name: 'mu-card-header',
  props: {
    title: {
      type: String
    },
    titleClass: {
      type: [String, Array, Object]
    },
    subTitle: {
      type: String
    },
    subTitleClass: {
      type: [String, Array, Object]
    }
  }
}
</script>
 
<style lang="less">
@import "../styles/import.less";
.mu-card-header {
  padding: 16px;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  .mu-avatar {
    margin-right: 16px;
  }
}
 
.mu-card-header-title{
  display: inline-block;
  vertical-align: top;
  white-space: normal;
  padding-right: 90px;
  .mu-card-title{
    font-size: 15px;
    color: fade(@textColor, 87%);
  }
  .mu-card-sub-title{
    font-size: 14px;
    color: fade(@textColor, 57%);
  }
}
</style>