index.vue 3.9 KB

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