<template>
  <div class="template-item">
    <van-image
      class="thumb"
      width="50px"
      height="50px"
      :src="thumb || require('@/assets/defaulttemplate.png')"
      round
      >
    </van-image>
    <div class="title van-ellipsis">
        {{title}}
    </div>      
    <div 
        class="desc van-multi-ellipsis--l2">
        {{desc}}
    </div>
    <common-svg name="tianjiabeifen" width="28px" height="28px" class="add" ></common-svg>
  </div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
@Component({
  name: 'TemplateItem',
})
export default class TemplateItem extends Vue {
  @Prop() private thumb!: string;
  @Prop() private title!: string;
  @Prop() private desc!: string;
}
</script>
<style scoped lang="scss">
  .template-item{
    display: grid;
    grid-template-columns: 50px auto 27px;
    grid-template-rows: repeat(2, minmax(25px,1fr));
    grid-auto-flow: column dense;
    place-items: center;
    grid-column-gap: 15px;
    overflow: hidden;
    margin-bottom: 15px;
    padding: 15px;
    background: #FFFFFF;
    box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.06);
    border-radius: 15px;
    color:#353535;
    text-align: left;
    font-size: 15px;
    .thumb{
      grid-row-start: span 2;
      width: 50px;
    }
    .title,.desc{
      place-self: center start;
    }
    .title{
      font-weight: 500;
    }
    .desc{
      font-size: 14px;
      color:#989898;
    }
    .add{
      grid-row-start: span 2;
      width:27px;
    }
  }
</style>
