Index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <el-container>
  3. <el-main>
  4. <el-col
  5. v-for="(more, index) in moreList"
  6. :key="index"
  7. :md="6"
  8. :sm="12"
  9. :xs="12"
  10. style="padding: 5px;"
  11. >
  12. <el-card class="box-card">
  13. <div slot="header" class="clearfix">
  14. <el-row>
  15. <el-col :md="4">
  16. <router-link target="_blank" :to="more.link">
  17. <el-avatar>
  18. <el-image :src="more.coverUrl" />
  19. </el-avatar>
  20. </router-link>
  21. </el-col>
  22. <el-col :md="16">
  23. <el-row style="padding: 5px;">
  24. <span v-html="more.title" />
  25. </el-row>
  26. <el-row style="padding: 5px;">
  27. <span v-html="more.desc" />
  28. </el-row>
  29. </el-col>
  30. </el-row>
  31. </div>
  32. </el-card>
  33. </el-col>
  34. </el-main>
  35. </el-container>
  36. </template>
  37. <script>
  38. export default {
  39. name: 'Index',
  40. data() {
  41. return {
  42. moreList: []
  43. }
  44. },
  45. watch: {
  46. // 地址栏 url 发生变化时重新加载本页面
  47. $route() {
  48. this.$router.go()
  49. }
  50. },
  51. created() {
  52. document.title = 'tnb'
  53. this.getData()
  54. },
  55. methods: {
  56. getData() {
  57. this.moreList.push(
  58. {
  59. title: 'vod',
  60. desc: '地图',
  61. link: '/vod',
  62. coverUrl: ''
  63. },
  64. {
  65. title: 'blog',
  66. desc: '地图',
  67. link: '/blog',
  68. coverUrl: ''
  69. },
  70. {
  71. title: 'disk',
  72. desc: '考试',
  73. link: '/disk',
  74. coverUrl: ''
  75. },
  76. {
  77. title: 'devops',
  78. desc: '商城',
  79. link: '/devops',
  80. coverUrl: ''
  81. },
  82. {
  83. title: 'bg',
  84. desc: '图表',
  85. link: '/background',
  86. coverUrl: ''
  87. }
  88. )
  89. }
  90. }
  91. }
  92. </script>
  93. <style>
  94. </style>