add.vue 1.04 KB
<template>
  <div>
    <div class="tabs">
      <GLTabs v-model="currentComponent" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
      <component :is="currentComponent" ref="componentRef"></component>
    </div>
  </div>
</template>
<script>
export default {
  components: {
    FreeInnovate: () => import('./FreeAdd.vue'),
    OffshoreProcurement: () => import('./OffAdd.vue')
  },
  data() {
    return {
      currentComponent: '',
      sourceType: this.$route.query.sourceType,
      tabPaneList: [
        {
          label: '自研红包',
          name: 'FreeInnovate'
        },
        {
          label: '外采红包',
          name: 'OffshoreProcurement'
        }
      ]
    }
  },
  created() {
    this.currentComponent = this.sourceType == 1 ? 'OffshoreProcurement' : 'FreeInnovate';
    this.handleClick()
  },
  methods: {
    handleClick(e) {
      if(this.sourceType){
        this.tabPaneList[0].disabled=true
        this.currentComponent='OffshoreProcurement'
      }
    }
  }
}
</script>
<style lang="scss" scoped>
</style>