UserInfo.vue 866 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div>
  3. <div class="user-info">
  4. 亲爱的,{{ name }}
  5. </div>
  6. <div v-if="subTitle || $scopedSlots.default" class="sub-title">
  7. <slot>{{ subTitle }}</slot>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import userIcon from "@/static/images/user-icon.png";
  13. export default {
  14. props: {
  15. name: {
  16. type: String,
  17. default: ""
  18. },
  19. subTitle: {
  20. type: String,
  21. default: ""
  22. }
  23. },
  24. data() {
  25. return {
  26. userIcon,
  27. }
  28. },
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .user-info {
  33. padding: 4rpx 0 4rpx 130rpx;
  34. font-weight: 400;
  35. font-size: 48rpx;
  36. color: #FFFFFF;
  37. background: url("../static/images/user-icon.png") no-repeat;
  38. background-size: auto 100%;
  39. }
  40. .sub-title {
  41. padding: 28rpx 0;
  42. font-weight: 400;
  43. font-size: 28rpx;
  44. color: rgba(255, 255, 255, 0.7);
  45. line-height: 40rpx;
  46. }
  47. </style>