index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div>
  3. <van-nav-bar title="首页" />
  4. <van-row>
  5. <van-col span="24">
  6. <van-swipe :autoplay="3000" :width="'100%'">
  7. <van-swipe-item v-for="(image, index) in images" :key="index">
  8. <img width="100%" height="100%" :src="image" />
  9. </van-swipe-item>
  10. </van-swipe>
  11. </van-col>
  12. </van-row>
  13. <div style="height: 500px">
  14. <van-grid :column-num="3" clickable :gutter="10" style="margin-top: 20px">
  15. <van-grid-item
  16. style="color: #b2568c"
  17. v-for="value in items"
  18. :key="value.name"
  19. :text="value.name"
  20. :to="value.to"
  21. :icon="value.icon"
  22. >
  23. </van-grid-item>
  24. </van-grid>
  25. </div>
  26. <van-tabbar route active-color="#B2568C" inactive-color="#999">
  27. <van-tabbar-item replace to="/" icon="wap-home"> 首页 </van-tabbar-item>
  28. <van-tabbar-item replace to="/sign" icon="user-o"> 签到 </van-tabbar-item>
  29. </van-tabbar>
  30. </div>
  31. </template>
  32. <script>
  33. import img from '../static/img.jpg'
  34. export default {
  35. name: 'Main',
  36. data() {
  37. return {
  38. images: [img],
  39. items: [
  40. {
  41. name: '统计报表',
  42. img: 'https://cdn.jsdelivr.net/npm/@vant/assets/cat.jpeg',
  43. to: '/report',
  44. icon: 'chart-trending-o'
  45. },
  46. {
  47. name: '签到打卡',
  48. img: 'https://cdn.jsdelivr.net/npm/@vant/assets/cat.jpeg',
  49. to: '/sign',
  50. icon: 'todo-list'
  51. },
  52. {
  53. name: '退出登录',
  54. img: 'https://cdn.jsdelivr.net/npm/@vant/assets/cat.jpeg',
  55. to: '/logout',
  56. icon: 'replay'
  57. }
  58. ]
  59. }
  60. },
  61. watch: {},
  62. mounted() {},
  63. methods: {}
  64. }
  65. </script>