ClientUserAvatar.vue 553 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <div class="user-name" style="background-color: rgb(255, 110, 110)">
  3. {{ u_name_display }}
  4. </div>
  5. </template>
  6. <script setup>
  7. import { ref, inject, computed } from "vue";
  8. const { helper, ajax } = inject("$global");
  9. const userName = ref(helper.read("userName") || "");
  10. const u_name_display = computed(() => {
  11. return userName.value.slice(0, 1);
  12. });
  13. </script>
  14. <style scoped>
  15. .user-name {
  16. width: 28px;
  17. height: 28px;
  18. border-radius: 14px;
  19. display: flex;
  20. align-items: center;
  21. justify-content: center;
  22. color: #fff;
  23. }
  24. </style>