index.vue
1.08 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 class="container-wrap">
<tab :list="list" :sticky="sticky" :index="tabIndex" @change="changeTabs" ></tab>
<!-- 已通过 -->
<tag :isTitle="isTitle" v-if="tabIndex == 2" id="tabId"></tag>
<!-- 添加 待通过 全部-->
<add v-else :tabIndex="tabIndex" id="tabId"></add>
</div>
</template>
<script>
import add from './add'
import tag from '../tag/index.vue'
export default {
name: 'customerDetails',
data() {
return {
list: ['待添加', '待通过', '已通过', '全部'], //0.待添加 1.待接受 2.已完成
sticky: true,
isTitle: false, //是否显示search组件
tabIndex: 0,
customerList: []
}
},
components: {
add,
tag
},
created() {
},
methods: {
changeTabs(e) {
console.log(e)
let tabTop = document.querySelector('#tabId').offsetTop
this.$nextTick(() => {
document.querySelector('#van-list')!= null? document.querySelector('#van-list').scrollTop = tabTop+'px':''
})
this.tabIndex = e
}
}
}
</script>
<style lang="scss" scoped>
</style>