User.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div class="mb-h5-user-item">
  3. <img :src="src" class="mb-user1-img" alt="user" />
  4. <div class="mb-user1-text">{{ text }}</div>
  5. <img v-if="tailSrc" class="mb-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. .mb-h5-user-item {
  29. position: relative;
  30. display: flex;
  31. flex-direction: column;
  32. justify-content: center;
  33. align-items: center;
  34. .mb-user1-img {
  35. width: 22px;
  36. }
  37. .mb-user1-text {
  38. display: flex;
  39. width: 46px;
  40. height: 15px;
  41. justify-content: center;
  42. align-items: center;
  43. align-self: stretch;
  44. border-radius: 4px;
  45. border: 1px solid #A39DFF;
  46. background: #3F337D;
  47. color: #FFF;
  48. font-size: 10px;
  49. font-weight: 400;
  50. line-height: 10px;
  51. }
  52. .mb-user-tail {
  53. position: absolute;
  54. width: 3px;
  55. height: 30px;
  56. top: 100%;
  57. right: 48%;
  58. transform: translateX(-50%);
  59. pointer-events: none;
  60. z-index: 0;
  61. }
  62. }
  63. </style>