index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!-- -->
  2. <template>
  3. <div class="Events">
  4. <div class="ban"></div>
  5. <div class="pos">
  6. <span class="pos1">Your Position:&nbsp;</span>
  7. <Router-link to="/Layout/Home">Home></Router-link>
  8. <Router-link to="/Layout/Events">Events></Router-link>
  9. </div>
  10. <div class="conten">
  11. <h1 class="cTitle">EVENTS</h1>
  12. <ul>
  13. <li v-for="(item, index) in data" :key="index" @click="skip(item.id)">
  14. <img :src="`/data/About/Events/${index + 1}.jpg`" alt="" />
  15. <div class="item">
  16. <h2 v-html="item.h3"></h2>
  17. <div class="s">
  18. <p @click.stop="skip(val.path)" v-for="(val,index) in item.txt" :key="index">{{val.name}}</p>
  19. </div>
  20. <i class="d">Date:{{ item.i }}</i>
  21. </div>
  22. </li>
  23. </ul>
  24. </div>
  25. <!-- <a href="#/Layout/EventsInfo/1"></a> -->
  26. </div>
  27. </template>
  28. <script>
  29. import { AboutOne } from "../dataAll";
  30. export default {
  31. //import引入的组件需要注入到对象中才能使用
  32. components: {},
  33. data() {
  34. //这里存放数据
  35. return {
  36. data: [],
  37. };
  38. },
  39. //监听属性 类似于data概念
  40. computed: {},
  41. //监控data中的数据变化
  42. watch: {},
  43. //方法集合
  44. methods: {
  45. skip(id) {
  46. this.$router.push(`/Layout/EventsInfo/${id}`);
  47. },
  48. },
  49. //生命周期 - 创建完成(可以访问当前this实例)
  50. created() {
  51. this.data = AboutOne
  52. },
  53. //生命周期 - 挂载完成(可以访问DOM元素)
  54. mounted() {},
  55. beforeCreate() {}, //生命周期 - 创建之前
  56. beforeMount() {}, //生命周期 - 挂载之前
  57. beforeUpdate() {}, //生命周期 - 更新之前
  58. updated() {}, //生命周期 - 更新之后
  59. beforeDestroy() {}, //生命周期 - 销毁之前
  60. destroyed() {}, //生命周期 - 销毁完成
  61. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  62. };
  63. </script>
  64. <style lang='less' scoped>
  65. .Events {
  66. .ban {
  67. width: 100%;
  68. margin: auto;
  69. background: url("/data/About/banner.jpg") no-repeat center top #000000;
  70. height: 300px;
  71. }
  72. .pos {
  73. height: 28px;
  74. line-height: 28px;
  75. font-size: 12px;
  76. margin: 0 auto 10px auto;
  77. width: 1180px;
  78. .pos1 {
  79. color: #c20e11;
  80. }
  81. }
  82. .conten {
  83. background-color: #fff;
  84. width: 1180px;
  85. margin: 0 auto 60px auto;
  86. padding: 20px 0 40px 0;
  87. .cTitle {
  88. font-weight: 700;
  89. font-family: Georgia;
  90. font-size: 40px;
  91. color: #151313;
  92. line-height: 58px;
  93. background: url("/data/About/eve.gif") repeat-x left bottom;
  94. text-align: center;
  95. width: 900px;
  96. margin: 0 auto 30px auto;
  97. padding-bottom: 7px;
  98. }
  99. & > ul {
  100. width: 900px;
  101. margin: 0 auto;
  102. & > li {
  103. cursor: pointer;
  104. box-shadow: 0 5px 5px rgba(0, 0, 0, 0.5);
  105. height: 450px;
  106. margin-bottom: 40px;
  107. position: relative;
  108. & > img {
  109. width: 100%;
  110. height: 100%;
  111. object-fit: cover;
  112. border: none;
  113. vertical-align: top;
  114. }
  115. .item {
  116. text-align: center;
  117. width: 532px;
  118. position: absolute;
  119. left: 184px;
  120. top: 125px;
  121. & > h2 {
  122. font-weight: 700;
  123. font-family: Helvetica;
  124. font-size: 24px;
  125. color: #fff;
  126. line-height: 30px;
  127. border-bottom: 4px solid rgba(255, 255, 255, 0.7);
  128. padding-bottom: 15px;
  129. /deep/ span {
  130. color: rgb(255, 0, 0);
  131. }
  132. }
  133. .s {
  134. font-family: Georgia;
  135. font-size: 16px;
  136. color: rgba(255, 255, 255, 0.7);
  137. line-height: 20px;
  138. padding: 15px 0;
  139. /deep/ p {
  140. width: 350px;
  141. text-align: left;
  142. color: rgba(255, 255, 255, 0.7);
  143. margin: 0 auto;
  144. }
  145. }
  146. .d {
  147. font-family: Georgia;
  148. font-size: 16px;
  149. color: #fff;
  150. line-height: 20px;
  151. font-style: italic;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. </style>