index.vue 1.28 KB
<template>
  <div class="appropriate">
    <el-tabs v-model="activeName" type="card" @tab-click="handleTabChange">
      <el-tab-pane label="我发起的调拨" name="alloctList"></el-tab-pane>
      <el-tab-pane label="我收到的调拨" name="transferShipmentList"></el-tab-pane>
    </el-tabs>
    <component :is="activeName" :ref="activeName" />
  </div>
</template>

<script>
import alloctList from '../allocation/index.vue'
import transferShipmentList from '../transferShipment/index.vue'
export default {
  components: {
    alloctList,
    transferShipmentList
  },

  data() {
    return {
      activeName: 'alloctList'
    }
  },
  methods: {
    handleTabChange() {
      this.$nextTick(() => {
        this.$refs[this.activeName].handleSearch()
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.appropriate {
  ::v-deep .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
    border-bottom: 1px solid #5850ff !important;
  }
  ::v-deep .el-tabs--card > .el-tabs__header .el-tabs__nav {
    border: 1px solid transparent !important;
  }
  // ::v-deep .el-tabs__nav .el-tabs__item:nth-child(1) {
  //   border-right: 1px solid transparent !important;
  // }
  ::v-deep .el-tabs__nav .el-tabs__item:nth-child(2) {
    border-left: 1px solid transparent !important;
  }
}
</style>