<template>
  <el-tabs class="p20" v-model="activeIndex">
    <el-tab-pane label="全部" :name="''">
      <delivery-list :type="''"></delivery-list>
    </el-tab-pane>
    <el-tab-pane :label="`待发货（${count}）`" :name="0">
      <delivery-list :type="0" @count="setCount"></delivery-list>
    </el-tab-pane>
    <el-tab-pane label="已发货" :name="1">
      <delivery-list :type="1"></delivery-list>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import deliveryList from './delivery-list';

export default {
  name: 'Delivery',
  components: { deliveryList },
  data() {
    return {
      activeIndex: '',
      count: 0,
    };
  },
  mounted() {
    this.$emit('updateBread', [
      {
        breadName: '福利中心'
      },
      {
        breadName: '履约管理'
      },
      {
        breadName: '发货单'
      },
    ]);
  },
  methods: {
    setCount(value) {
      this.count = value;
    }
  }
};
</script>
