tab4-2.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!-- -->
  2. <template>
  3. <div class="tab4-2">
  4. <div class="top">
  5. 美丽校园
  6. <div class="search">
  7. <el-input
  8. placeholder="搜索"
  9. suffix-icon="el-icon-search"
  10. v-model="search"
  11. >
  12. </el-input>
  13. <span class="btn" @click="mySearch"></span>
  14. </div>
  15. </div>
  16. <!-- 内容 -->
  17. <div class="conten">
  18. <div
  19. class="row"
  20. v-for="i in 8"
  21. :key="i"
  22. >
  23. <el-image
  24. style="width: 380px; height: 240px"
  25. :src="url"
  26. :preview-src-list="srcList"
  27. >
  28. </el-image>
  29. <!-- <img src="../../assets/img/demo2.png" alt="" /> -->
  30. <p>图片名称</p>
  31. </div>
  32. </div>
  33. <!-- 分页 -->
  34. <!-- :page-sizes="[15, 30, 45, 60]"
  35. :current-page="from2.pageNum"
  36. @current-change="currentChange"
  37. @size-change="sizeChange"
  38. -->
  39. <div class="paging">
  40. <el-pagination layout="prev,pager,next,jumper" :total="100">
  41. </el-pagination>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. export default {
  47. name: 'tab4-2',
  48. components: {},
  49. data () {
  50. // 这里存放数据
  51. return {
  52. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  53. srcList: ['https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg', 'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'],
  54. search: ''
  55. }
  56. },
  57. // 监听属性 类似于data概念
  58. computed: {},
  59. // 监控data中的数据变化
  60. watch: {},
  61. // 方法集合
  62. methods: {
  63. mySearch () {
  64. console.log('点击了搜索')
  65. }
  66. },
  67. // 生命周期 - 创建完成(可以访问当前this实例)
  68. created () {},
  69. // 生命周期 - 挂载完成(可以访问DOM元素)
  70. mounted () {},
  71. beforeCreate () {}, // 生命周期 - 创建之前
  72. beforeMount () {}, // 生命周期 - 挂载之前
  73. beforeUpdate () {}, // 生命周期 - 更新之前
  74. updated () {}, // 生命周期 - 更新之后
  75. beforeDestroy () {}, // 生命周期 - 销毁之前
  76. destroyed () {}, // 生命周期 - 销毁完成
  77. activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
  78. }
  79. </script>
  80. <style lang='less' scoped>
  81. .tab4-2 {
  82. position: relative;
  83. min-width: 1600px;
  84. height: 100%;
  85. padding: 40px 40px 0;
  86. color: black;
  87. .top {
  88. position: relative;
  89. width: 100%;
  90. text-align: center;
  91. color: #b9412e;
  92. font-size: 26px;
  93. font-weight: 700;
  94. .search {
  95. right: 50px;
  96. bottom: 0;
  97. position: absolute;
  98. .btn {
  99. cursor: pointer;
  100. position: absolute;
  101. right: 0;
  102. top: 0;
  103. height: 40px;
  104. width: 40px;
  105. background-color: transparent;
  106. }
  107. }
  108. }
  109. .conten {
  110. margin-top: 30px;
  111. min-width: 1650px;
  112. display: flex;
  113. justify-content: space-between;
  114. flex-wrap: wrap;
  115. .row {
  116. cursor: pointer;
  117. margin: 40px 0px;
  118. width: 380px;
  119. height: auto;
  120. /deep/.el-image__preview{
  121. object-fit: cover;
  122. }
  123. & > img {
  124. width: 380px;
  125. height: 240px;
  126. }
  127. & > p {
  128. margin-top: 8px;
  129. text-align: center;
  130. }
  131. }
  132. }
  133. .paging {
  134. position: absolute;
  135. left: 50%;
  136. bottom: 50px;
  137. transform: translateX(-50%);
  138. }
  139. }
  140. </style>