iconGangwei.vue 759 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div class="gangwei-icon">
  3. <i :style="iconStyle"></i>
  4. <p>{{ des.text }}</p>
  5. </div>
  6. </template>
  7. <script>
  8. export default {
  9. name: "iconGangwei",
  10. props: {
  11. des: {
  12. type: Object,
  13. required: true
  14. }
  15. },
  16. computed: {
  17. iconStyle() {
  18. return `background-image: url(${this.des.icon})`;
  19. }
  20. }
  21. }
  22. </script>
  23. <style lang="scss" scoped>
  24. .gangwei-icon {
  25. text-align: center;
  26. i {
  27. display: block;
  28. width: 200px;
  29. height: 160px;
  30. background-size: contain;
  31. background-repeat: no-repeat;
  32. background-position: center;
  33. }
  34. p {
  35. margin-top: 25px;
  36. font-size: 18px;
  37. font-weight: 800;
  38. }
  39. @media (max-width: 768px){
  40. i {
  41. width: 150px;
  42. height: 120px;
  43. }
  44. }
  45. }
  46. </style>