<template>
  <div class="form-wrap">
    <div style="padding: 10px">
      <el-tabs
        v-model="activeName"
        @tab-click="handleTabClick">
        <el-tab-pane
          name="channel"
          label="渠道管理">
          <Channel ref="channel" />
        </el-tab-pane>
        <el-tab-pane
          name="seller"
          label="销售方管理">
          <Seller ref="seller" />
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
import Channel from './Channel'
import Seller from './Seller'

export default {
  components: {
    Channel,
    Seller
  },
  data () {
    return {
      activeName: 'channel'
    }
  },
  mounted () {
    this.$refs.channel.getList()
  },
  methods: {
    handleTabClick (tab, e) {
      console.log(tab.name)
      if (this.$refs[tab.name]) {
        this.$refs[tab.name].getList()
      }
    }
  }
}
</script>

  <style lang="scss" scoped>
  .offSale-btn{
    color: #F56C6C
  }
  .onSale-btn{
    color: #67C23A
  }
  </style>
