User.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div class="h5-user-item">
  3. <img width="22" :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="user" 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. .h5-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: 46PX;
  37. height: 15PX;
  38. justify-content: center;
  39. align-items: center;
  40. align-self: stretch;
  41. border-radius: 4PX;
  42. border: 1PX solid #A39DFF;
  43. background: #3F337D;
  44. color: #FFF;
  45. font-size: 10PX;
  46. font-weight: 400;
  47. line-height: 10PX;
  48. }
  49. .user-tail {
  50. position: absolute;
  51. width: 3PX;
  52. height: 30PX;
  53. top: 100%;
  54. right: 48%;
  55. transform: translateX(-50%);
  56. pointer-events: none;
  57. z-index: 0;
  58. }
  59. }
  60. </style>