all files / src/card/ cardMedia.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 64 65 66                                                                                                                                   
<template>
<div class="mu-card-media">
  <slot></slot>
  <div v-if="title || subTitle" class="mu-card-media-title">
    <div class="mu-card-title" v-if="title" :class="titleClass">
      {{title}}
    </div>
    <div class="mu-card-sub-title" v-if="subTitle" :class="subTitleClass">
      {{subTitle}}
    </div>
  </div>
</div>
</template>
 
<script>
export default {
  name: 'mu-card-media',
  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-media {
  position: relative;
  > img {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    display: block;
    vertical-align: top;
  }
}
 
.mu-card-media-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  background-color: @lightBlack;
  .mu-card-title {
    font-size: 24px;
    color: @darkWhite;
    line-height: 36px;
  }
  .mu-card-sub-title {
    color: @lightWhite;
    font-size: 14px;
  }
}
</style>