index.vue
997 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
50
51
52
53
54
55
56
57
58
59
<template>
<div class="chat-layout">
<GLTabs
v-model="cName"
:tabPaneList="tabPaneList"
@tab-click="handleClick"
></GLTabs>
<div class="component">
<component
:is="currentComponent"
ref="componentRef"
></component>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import ai from './components/AI/index.vue'
import work from './components/Work/index.vue'
export default {
components: {
ai,
work,
},
name: '',
data () {
return {
cName: '1',
currentComponent: 'ai',
tabPaneList: [
{
label: '智能AI话术',
name: '1'
},
{
label: '企业话术',
name: '2'
},
]
}
},
mounted () {
},
methods: {
handleClick () {
this.currentComponent = {
1: 'ai',
2: 'work',
}[this.cName]
}
}
}
</script>
<style scoped lang='scss'>
.component{
margin-top: 16px;
}
</style>