<template>
  <div>
    <div>
      <!-- 客户页 -->
      <customer-list v-if='showType==="customerList" '
                     @goDetails='goDetails' :customer="customer"
      >
      </customer-list>
      <!-- 详情 -->
      <customer-details v-if='showType==="customerDetails" '
                        @goLists='goLists' :customer="customer"
                       >
      </customer-details>
      <!-- 点击后 同一客户所有列表 -->
      <customer-historys v-if='showType==="customerHistory" '
                        @customerHistory='customerHistory'
                         @customerList='customerList':customer="customer"
      >
      </customer-historys>
    </div>


  </div>
</template>
<script>
  import CustomerList from '@views/customer/CustomerList.vue'
  import CustomerDetails from '@views/customer/CustomerDetails.vue'
  import CustomerHistorys from '@views/customer/CustomerHistorys.vue'
  export default {
    components: { CustomerList,CustomerDetails,CustomerHistorys },

    data () {
      return {
        description: '反诈客户',
        showType: 'customerList',
        customer:{}
      }
    },
    methods:{
      goDetails(customer){
        this.showType = 'customerHistory'
        this.customer = customer;
       },
      goLists(customer){
        this.showType = 'customerHistory'
        this.customer = customer;
      },
      customerHistory(customer){
        this.showType = 'customerDetails'
        this.customer = customer;
      },
      customerList(customer){
        this.showType = 'customerList'
        this.customer = customer;
      }
    }
  }
</script>