User.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div class="user-item">
  3. <img width="72" :src="src" class="user1-img" alt="user" />
  4. <div class="user1-text">{{ text }}</div>
  5. <img v-if="tailSrc" class="user-tail" :src="tailSrc" alt="" aria-hidden="true" />
  6. </div>
  7. </template>
  8. <script setup>
  9. import defaultUserSrc from '~/assets/svg/home/user1.svg'
  10. const props = defineProps({
  11. text: {
  12. type: String,
  13. default: "正常访客",
  14. required: true,
  15. },
  16. src: {
  17. type: String,
  18. default: defaultUserSrc,
  19. required: true,
  20. },
  21. tailSrc: {
  22. type: String,
  23. default: "",
  24. },
  25. });
  26. </script>
  27. <style lang="scss" scoped>
  28. .user-item {
  29. position: relative;
  30. display: flex;
  31. flex-direction: column;
  32. justify-content: center;
  33. align-items: center;
  34. .user1-text {
  35. display: flex;
  36. width: 162px;
  37. height: 54px;
  38. justify-content: center;
  39. align-items: center;
  40. align-self: stretch;
  41. border-radius: 8px;
  42. border: 1px solid #A39DFF;
  43. background: #3F337D;
  44. color: #FFF;
  45. font-size: 20px;
  46. font-weight: 400;
  47. line-height: 20px;
  48. }
  49. }
  50. .user-tail {
  51. position: absolute;
  52. width: 14px;
  53. height: 151px;
  54. top: 100%;
  55. right: 40%;
  56. transform: translateX(-50%);
  57. pointer-events: none;
  58. }
  59. </style>