CustomerCard.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template lang="pug">
  2. .customer-card
  3. h2.customer-name {{ data.name }}
  4. img.customer-photo(:src="this.data.image_medium ? 'data:image/png;base64,' + this.data.image_medium : '/base/static/src/img/avatar.png'")
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. data: {
  10. type: Object,
  11. default: () => {
  12. return {}
  13. }
  14. }
  15. }
  16. }
  17. </script>
  18. <style lang="sass">
  19. .customer-card
  20. width: 130px
  21. height: 160px
  22. margin: 5px
  23. border: 1px solid #d3d3d3
  24. display: inline-block
  25. position: relative
  26. &:hover
  27. cursor: pointer
  28. .customer-name
  29. width: 100%
  30. height: 30px
  31. font-size: 9pt
  32. text-align: center
  33. margin-top: 10px
  34. position: absolute
  35. top: 0
  36. .customer-photo
  37. width: 80px
  38. height: 80px
  39. margin: 0
  40. border: none
  41. position: absolute;
  42. top: 50%
  43. left: 50%
  44. margin-right: -50%
  45. transform: translate(-50%, -50%)
  46. </style>