Index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div class='index'>
  3. <modal-window :showModal='showModal'>
  4. <slot>
  5. </slot>
  6. </modal-window>
  7. <div class='thread_sorting'>
  8. <select-button style='margin-right: 1rem' v-model='selected' :options='categories'></select-button>
  9. <div class='button button--orange'>New</div>
  10. <div class='button'>Most active</div>
  11. <div class='button'>No replies</div>
  12. </div>
  13. <table class='threads'>
  14. <colgroup>
  15. <col span="1" style="width: 50%;">
  16. <col span="1" style="width: 22.5%;">
  17. <col span="1" style="width: 22.5%;">
  18. <col span="1" style="width: 5%;">
  19. </colgroup>
  20. <thead>
  21. <tr class='thread thread--header'>
  22. <th>Title</th>
  23. <th>Latest post</th>
  24. <th>Category</th>
  25. <th>Replies</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <tr class='thread'>
  30. <td>A thread title here........</td>
  31. <td>
  32. <div>User</div>
  33. <div>0201/2017 10:07</div>
  34. </td>
  35. <td>A category here</td>
  36. <td>29</td>
  37. </tr>
  38. </tbody>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import SelectButton from '../SelectButton'
  44. import ModalWindow from '../ModalWindow'
  45. export default {
  46. name: 'index',
  47. components: {
  48. SelectButton,
  49. ModalWindow
  50. },
  51. data () {
  52. var categories = [
  53. { name: 'All categories', value: '1' },
  54. { name: 'Photography', value: '1' },
  55. { name: 'Baking', value: '1' },
  56. { name: 'Maps', value: '1' }
  57. ];
  58. return {
  59. selected: null,
  60. showModal: true,
  61. categories
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang='scss' scoped>
  67. @import '../../assets/scss/variables.scss';
  68. .index {
  69. width: 80%;
  70. margin: 0 auto;
  71. margin-top: 2rem;
  72. }
  73. .thread_sorting {
  74. margin-bottom: 1rem;
  75. }
  76. .threads {
  77. border-collapse: collapse;
  78. }
  79. .thread {
  80. background-color: #fff;
  81. padding: 0.5rem 0;
  82. cursor: default;
  83. text-align: left;
  84. transition: background-color 0.2s;
  85. &:hover {
  86. background-color: $color__lightgray--primary;
  87. }
  88. td, th {
  89. padding: 0 0.5rem;
  90. }
  91. @at-root #{&}--header {
  92. &:hover {
  93. background-color: #fff;
  94. }
  95. th {
  96. font-weight: 400;
  97. padding-bottom: 0.25rem;
  98. border-bottom: thin solid $color__lightgray--darkest;
  99. }
  100. }
  101. @at-root #{&}__section {
  102. padding: 0 0.5rem;
  103. }
  104. @at-root #{&}__user {
  105. display: inline-block;
  106. }
  107. @at-root #{&}__date {
  108. color: $color__text--secondary;
  109. display: inline-block;
  110. }
  111. }
  112. </style>