UsersList.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div class="sidebar" transition="slide">
  3. <div class="inner-wrapper">
  4. <div class="title">
  5. Users
  6. </div>
  7. <h5 class="center">Total users: {{ $parent.userCount }}</h5>
  8. <aside class="menu">
  9. <ul class="menu-list">
  10. <li v-for="(username, index) in $parent.users" :key="index">
  11. <router-link
  12. :to="{ name: 'profile', params: { username } }"
  13. target="_blank"
  14. >
  15. {{ username }}
  16. </router-link>
  17. </li>
  18. </ul>
  19. </aside>
  20. </div>
  21. </div>
  22. </template>
  23. <style lang="scss" scoped>
  24. .sidebar {
  25. position: fixed;
  26. z-index: 1;
  27. top: 0;
  28. right: 0;
  29. width: 300px;
  30. height: 100vh;
  31. background-color: #fff;
  32. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
  33. 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  34. }
  35. .inner-wrapper {
  36. top: 64px;
  37. position: relative;
  38. }
  39. .slide-transition {
  40. transition: transform 0.6s ease-in-out;
  41. transform: translateX(0);
  42. }
  43. .slide-enter,
  44. .slide-leave {
  45. transform: translateX(100%);
  46. }
  47. .title {
  48. background-color: rgb(3, 169, 244);
  49. text-align: center;
  50. padding: 10px;
  51. color: white;
  52. font-weight: 600;
  53. }
  54. .menu {
  55. padding: 0 20px;
  56. }
  57. .menu-list li a:hover {
  58. color: #000 !important;
  59. }
  60. </style>