index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="top">
  6. <top topType="1" @search="search"></top>
  7. </el-col>
  8. <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
  9. <list :list="refuteList"></list>
  10. </el-col>
  11. <el-col :span="24" class="foot">
  12. <page limit="5" :total="total" @search="search"></page>
  13. </el-col>
  14. </el-col>
  15. </el-row>
  16. </div>
  17. </template>
  18. <script>
  19. import list from './parts/list.vue';
  20. import top from '@/layout/common/top.vue';
  21. import page from '@/layout/common/page.vue';
  22. import { mapState, createNamespacedHelpers } from 'vuex';
  23. export default {
  24. name: 'index',
  25. props: {},
  26. components: {
  27. list,
  28. top,
  29. page,
  30. },
  31. data: function() {
  32. return {
  33. clientHeight: '',
  34. refuteList: [
  35. {
  36. imgUrl: require('@a/news1.jpg'),
  37. title: '文章标题',
  38. renew_time: '2021-03-25 21:12:44',
  39. },
  40. {
  41. imgUrl: require('@a/news1.jpg'),
  42. title: '文章标题',
  43. renew_time: '2021-03-25 21:12:44',
  44. },
  45. {
  46. imgUrl: require('@a/news1.jpg'),
  47. title: '文章标题',
  48. renew_time: '2021-03-25 21:12:44',
  49. },
  50. {
  51. imgUrl: require('@a/news1.jpg'),
  52. title: '文章标题',
  53. renew_time: '2021-03-25 21:12:44',
  54. },
  55. {
  56. imgUrl: require('@a/news1.jpg'),
  57. title: '文章标题',
  58. renew_time: '2021-03-25 21:12:44',
  59. },
  60. {
  61. imgUrl: require('@a/news1.jpg'),
  62. title: '文章标题',
  63. renew_time: '2021-03-25 21:12:44',
  64. },
  65. {
  66. imgUrl: require('@a/news1.jpg'),
  67. title: '文章标题',
  68. renew_time: '2021-03-25 21:12:44',
  69. },
  70. {
  71. imgUrl: require('@a/news1.jpg'),
  72. title: '文章标题',
  73. renew_time: '2021-03-25 21:12:44',
  74. },
  75. {
  76. imgUrl: require('@a/news1.jpg'),
  77. title: '文章标题',
  78. renew_time: '2021-03-25 21:12:44',
  79. },
  80. ],
  81. total: 0,
  82. };
  83. },
  84. async created() {
  85. await this.search();
  86. },
  87. mounted() {
  88. let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 80;
  89. this.$set(this, `clientHeight`, clientHeight);
  90. },
  91. methods: {
  92. search({ skip = 0, limit = 10, searchName, ...info } = {}) {
  93. console.log(searchName);
  94. },
  95. },
  96. computed: {
  97. ...mapState(['user']),
  98. },
  99. metaInfo() {
  100. return { title: this.$route.meta.title };
  101. },
  102. watch: {
  103. test: {
  104. deep: true,
  105. immediate: true,
  106. handler(val) {},
  107. },
  108. },
  109. };
  110. </script>
  111. <style lang="less" scoped>
  112. .main {
  113. .top {
  114. height: 40px;
  115. overflow: hidden;
  116. border-bottom: 1px solid #f1f1f1;
  117. }
  118. .info {
  119. overflow-x: hidden;
  120. overflow-y: auto;
  121. }
  122. .foot {
  123. height: 40px;
  124. overflow: hidden;
  125. border-top: 1px solid #f1f1f1;
  126. }
  127. }
  128. </style>