index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!-- -->
  2. <template>
  3. <div class="JoinSupport">
  4. <div class="ban" data-aria-viewport-area tabindex="0"
  5. aria-label :aria-description="`You've reached the banner area of the ${$route.meta.nameAll} page; this area has one image; please use the tab key to go through the content.`"
  6. ></div>
  7. <div class="nav_2" data-aria-viewport-area tabindex="0"
  8. aria-label aria-description="You've reached the secondary menu of the Join & Support section; this menu has two options; please use the tab key to go through the menu."
  9. >
  10. <ul>
  11. <li
  12. :class="{ cur: $route.meta.nameAll === item.url }"
  13. v-for="(item, index) in topLi"
  14. :key="index"
  15. @click="skip(item.url)"
  16. >
  17. <img
  18. :src="`/data/JoinSupport/${item.img}`"
  19. alt=""
  20. />
  21. <p>{{ item.name }}</p>
  22. </li>
  23. </ul>
  24. </div>
  25. <div class="pos" data-aria-viewport-area tabindex="0"
  26. aria-label aria-description="You've reached the path area, this area has three URLs; please use the tab key to navigate through the content."
  27. >
  28. <span class="pos1">Your Position:&nbsp;</span>
  29. <Router-link to="/Layout/Home">Home></Router-link>
  30. <Router-link to="/Layout/JoinSupport/Volunteer">Join & Support ></Router-link>
  31. <Router-link :to="`/Layout/JoinSupport/${$route.meta.nameAll}`">{{'Ways to '+$route.meta.nameAll}} ></Router-link>
  32. </div>
  33. <!-- 二级嵌套路由 -->
  34. <Router-view />
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. name: "JoinSupport",
  40. components: {},
  41. data() {
  42. //这里存放数据
  43. return {
  44. topLi: [
  45. {
  46. id: 1,
  47. name: "Ways to Volunteer",
  48. url:'Volunteer',
  49. img: "n1.png",
  50. },
  51. {
  52. id: 2,
  53. name: "Ways to Give",
  54. url:'Give',
  55. img: "n2.png",
  56. },
  57. ],
  58. };
  59. },
  60. //监听属性 类似于data概念
  61. computed: {},
  62. //监控data中的数据变化
  63. watch: {},
  64. //方法集合
  65. methods: {
  66. skip(url){
  67. this.$router.push(`/Layout/JoinSupport/${url}`).catch(() => {});
  68. }
  69. },
  70. //生命周期 - 创建完成(可以访问当前this实例)
  71. created() {},
  72. //生命周期 - 挂载完成(可以访问DOM元素)
  73. mounted() {},
  74. beforeCreate() {}, //生命周期 - 创建之前
  75. beforeMount() {}, //生命周期 - 挂载之前
  76. beforeUpdate() {}, //生命周期 - 更新之前
  77. updated() {}, //生命周期 - 更新之后
  78. beforeDestroy() {}, //生命周期 - 销毁之前
  79. destroyed() {}, //生命周期 - 销毁完成
  80. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  81. };
  82. </script>
  83. <style lang='less' scoped>
  84. .JoinSupport {
  85. background-color: #fff;
  86. .ban {
  87. width: 100%;
  88. margin: auto;
  89. background: url("/data/JoinSupport/banner.jpg") no-repeat
  90. center top #000000;
  91. height: 300px;
  92. }
  93. .nav_2 {
  94. width: 100%;
  95. padding-bottom: 8px;
  96. background: url("../../assets/images/Visit/bg_3.png") left bottom repeat-x
  97. #fff;
  98. overflow: hidden;
  99. zoom: 1;
  100. & > ul {
  101. display: flex;
  102. width: 1180px;
  103. margin: 0 auto;
  104. & > li {
  105. background: #fff;
  106. cursor: pointer;
  107. width: 168px;
  108. height: 108px;
  109. text-align: center;
  110. & > img {
  111. margin-top: 25px;
  112. }
  113. & > p {
  114. margin-top: 5px;
  115. font-size: 14px;
  116. line-height: 18px;
  117. }
  118. }
  119. .cur {
  120. background: url("../../assets/images/Visit/bg_1.jpg") center top
  121. no-repeat #f1f1f1;
  122. }
  123. }
  124. }
  125. .pos {
  126. height: 28px;
  127. line-height: 28px;
  128. font-size: 12px;
  129. margin: 0 auto 10px auto;
  130. width: 1180px;
  131. .pos1 {
  132. color: #c20e11;
  133. }
  134. }
  135. }
  136. </style>