<template>
  <div class="app-container">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClicks">
      <el-tab-pane label="抓取任务" name="first">
        <materialTask v-if="isSecond"></materialTask>
      </el-tab-pane>
      <el-tab-pane label="已抓取内容" name="second">
        <materialContent v-if="isFirst"></materialContent>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
// import { getUrlKey } from "../uti";
import materialContent from './common/materialContent'
import materialTask from './common/materialTask'
export default {
  components: {
    materialContent,
    materialTask
  },
  data() {
    return {

      activeName: 'first',
      isFirst: false,
      isSecond: true
    }
  },
  created() {
  },
  methods: {
    handleClicks(tab) {
      console.log(tab.name)
      if (tab.name === 'first') {
        this.isFirst = false
        this.isSecond = true
      } else if (tab.name === 'second') {
        this.isFirst = true
        this.isSecond = false
      }
    }
  }
}
</script>
