数字化园区前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Index.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!-- 园区资讯问答 -->
  2. <template>
  3. <div class="information">
  4. <section class="nav_box">
  5. <Nav></Nav>
  6. <div class="second_nv">
  7. <div>
  8. <div class="position">
  9. <img src="@assets/image/company/icon_address.png" alt="地址" />
  10. <span>
  11. 当前位置:
  12. <span
  13. class="pointer"
  14. @click="$router.push('/park-information/question-list')"
  15. >
  16. 园区资讯问答
  17. </span>
  18. <template v-if="currentPage">
  19. <span style="margin:0 4px;">></span>
  20. <span class="current pointer">{{ currentPage }}</span>
  21. </template>
  22. </span>
  23. </div>
  24. <div class="head_title">
  25. <span class="text">园区资讯问答</span>
  26. <span class="english">Questions and Answers</span>
  27. </div>
  28. </div>
  29. </div>
  30. </section>
  31. <section class="content_box">
  32. <router-view></router-view>
  33. </section>
  34. <Footer></Footer>
  35. </div>
  36. </template>
  37. <script>
  38. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  39. //例如:import 《组件名称》 from '《组件路径》';
  40. import Nav from "@components/Header.vue";
  41. import Footer from "@components/Footer.vue";
  42. export default {
  43. //import引入的组件需要注入到对象中才能使用
  44. components: { Nav, Footer },
  45. data() {
  46. //这里存放数据
  47. return {
  48. currentPage: "",
  49. };
  50. },
  51. //监听属性 类似于data概念
  52. computed: {},
  53. //监控data中的数据变化
  54. watch: {
  55. $route: {
  56. handler(newVal) {
  57. this.setCurrentPage(newVal);
  58. },
  59. },
  60. deep: true,
  61. },
  62. //方法集合
  63. methods: {
  64. setCurrentPage(route) {
  65. if (route.name === "QuestionDetail") {
  66. this.currentPage = "详情";
  67. } else if (route.name === "QuestionSearch") {
  68. this.currentPage = "搜索页";
  69. } else {
  70. this.currentPage = "";
  71. }
  72. },
  73. },
  74. //生命周期 - 创建完成(可以访问当前this实例)
  75. created() {
  76. this.setCurrentPage(this.$route);
  77. },
  78. //生命周期 - 挂载完成(可以访问DOM元素)
  79. mounted() {},
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. //@import url(); 引入公共css类
  84. .nav_box {
  85. background-image: linear-gradient(135deg, #42a6fe 0%, #0070d2 100%);
  86. .second_nv {
  87. @include size(100%, 140px);
  88. > div {
  89. @include size(1200px, 100%);
  90. margin: 0 auto;
  91. @include flex(column, flex-start, flex-start, null);
  92. position: relative;
  93. }
  94. .head_title {
  95. width: 100%;
  96. @include flex(column, center, center, null);
  97. .text {
  98. @include font(36px, #ffffff);
  99. font-weight: 600;
  100. }
  101. .english {
  102. @include font(14px, #ffffff);
  103. margin-top: 4px;
  104. }
  105. }
  106. .position {
  107. @include flex(row, flex-start, center, null);
  108. img {
  109. // @include size(16px, 16px);
  110. margin-right: 6px;
  111. }
  112. padding-top: 10px;
  113. @include border-box;
  114. @include font(16px, #ffffff);
  115. .current {
  116. font-weight: 600;
  117. }
  118. }
  119. }
  120. }
  121. .content_box {
  122. width: 1200px;
  123. min-height: 700px;
  124. margin: 0 auto;
  125. padding: 30px 0;
  126. @include border-box;
  127. }
  128. </style>