index.vue 1.08 KB
<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>