Index.vue 2.5 KB

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