index.vue
941 Bytes
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
47
48
49
<template>
<div class="container">
<GLTabs class="tab" v-model="tabId" :tabPaneList="tabPaneList"></GLTabs>
<template v-if="tabId == '2'">
<goodIndex></goodIndex>
</template>
<template v-else>
<prodIndex></prodIndex>
</template>
</div>
</template>
<script>
import goodIndex from './goodIndex.vue'
import prodIndex from './prodIndex.vue'
export default {
name: 'index',
components: {
goodIndex,
prodIndex
},
beforeRouteEnter(to, from, next) {
next(vm => {
if (from.path.indexOf('/ContractManager/addTmpl') == 0 && from.path.indexOf('skuId') == -1) {
vm.tabId = '2'
}
})
},
data() {
return {
tabId: '1',
tabPaneList: [
{ name: '1', label: '产品合同' },
{ name: '2', label: '商品合同' }
]
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.tab {
margin-bottom: 16px;
}
</style>