add.vue
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<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>