UsersList.vue 1.2 KB

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