<template>
  <el-container>
    <el-main>
      <el-col
        v-for="(more, index) in moreList"
        :key="index"
        :md="6"
        :sm="12"
        :xs="12"
        style="padding: 5px;"
      >
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <el-row>
              <el-col :md="4">
                <router-link target="_blank" :to="more.link">
                  <el-avatar>
                    <el-image :src="more.coverUrl" />
                  </el-avatar>
                </router-link>
              </el-col>
              <el-col :md="16">
                <el-row style="padding: 5px;">
                  <span v-html="more.title" />
                </el-row>
                <el-row style="padding: 5px;">
                  <span v-html="more.desc" />
                </el-row>
              </el-col>
            </el-row>
          </div>
        </el-card>
      </el-col>
    </el-main>
  </el-container>
</template>

<script>
export default {
  name: 'Index',
  data() {
    return {
      moreList: []
    }
  },
  watch: {
    // 地址栏 url 发生变化时重新加载本页面
    $route() {
      this.$router.go()
    }
  },
  created() {
    document.title = 'tnb'
    this.getData()
  },
  methods: {
    getData() {
      this.moreList.push(
        {
          title: 'vod',
          desc: '地图',
          link: '/vod',
          coverUrl: ''
        },
        {
          title: 'blog',
          desc: '地图',
          link: '/blog',
          coverUrl: ''
        },
        {
          title: 'disk',
          desc: '考试',
          link: '/disk',
          coverUrl: ''
        },
        {
          title: 'devops',
          desc: '商城',
          link: '/devops',
          coverUrl: ''
        },
        {
          title: 'bg',
          desc: '图表',
          link: '/background',
          coverUrl: ''
        }
      )
    }
  }
}
</script>

<style>
</style>
