Home.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div class="home">
  3. <!--<img alt="Vue logo" src="../assets/logo.png">-->
  4. <!--<HelloWorld msg="Welcome to Your Vue.js App"/>-->
  5. <div class="home-box" v-for="(item,index) in pageModelList" :key="index" @click="goDetail(item.path)">
  6. <div class="home-left">
  7. <div class="home-title-font">{{item.title}}</div>
  8. <div class="home-bottom-font">点击进入</div>
  9. </div>
  10. <div class="img-box">
  11. <img :src="item.img" alt="">
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. // @ is an alias to /src
  18. // import HelloWorld from '@/components/HelloWorld.vue'
  19. export default {
  20. name: 'home',
  21. components: {
  22. // HelloWorld
  23. },
  24. data(){
  25. return {
  26. pageModelList:[
  27. {
  28. title:'企业信息统计',
  29. path:'/company',
  30. img:require('../assets/default.png')
  31. },
  32. {
  33. title:'咨询诉求统计',
  34. path:'/consult',
  35. img:require('../assets/default.png')
  36. },
  37. {
  38. title:'园区信息统计',
  39. path:'/park',
  40. img:require('../assets/default.png')
  41. }
  42. ]
  43. }
  44. },
  45. methods:{
  46. goDetail(path){
  47. this.$router.push(path)
  48. }
  49. }
  50. }
  51. </script>
  52. <style>
  53. .home {
  54. height: 100%;
  55. display: flex;
  56. justify-content: center;
  57. flex-direction: column;
  58. align-items: center;
  59. background-color: #F1F4F9;
  60. }
  61. .home-box {
  62. width: 80%;
  63. border-radius: 15px;
  64. background-color: #3E93FC;
  65. display: flex;
  66. justify-content: space-around;
  67. height: 21%;
  68. margin: 20px 0 20px 0;
  69. padding: 18px;
  70. color: #fff;
  71. }
  72. .home-left {
  73. display: flex;
  74. flex-direction: column;
  75. justify-content: space-between;
  76. }
  77. .home-title-font {
  78. font-size: 22px;
  79. font-weight: bold;
  80. }
  81. .home-bottom-font {
  82. background-color: #fff;
  83. color: #999DAB;
  84. font-size: 14px;
  85. width: 49%;
  86. border-radius: 5px;
  87. padding: 2px;
  88. }
  89. .img-box {
  90. width: 50%;
  91. height: 100%;
  92. }
  93. .img-box img {
  94. width: 100%;
  95. height: 100%;
  96. margin-top: 10px;
  97. }
  98. </style>