Index.vue 2.3 KB

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