<template>
  <div class="priceAdjust">
    <el-tabs v-model="activeName" @tab-click="handleClick" >
      <el-tab-pane  label="油品信息" name="price" >
        <child1 v-if="isChildUpdate1" ></child1>
      </el-tab-pane>
      <el-tab-pane ref="child2" label="调价记录" name="adjust">
        <child2 v-if="isChildUpdate2"></child2>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
  import price from '../price/index.vue'
  import adjust from '../adjust/index.vue'
  export default {
    name: 'priceAdjust',
    components:{
      child1:price,
      child2:adjust
    },
    data() {
      return {
        activeName: 'price',
        isChildUpdate1: true,
        isChildUpdate2: false
      };
    },
    methods: {
      handleClick (tab) {
        if (tab.name === 'price') {
          this.isChildUpdate1 = true
          this.isChildUpdate2 = false
        } else if (tab.name === 'adjust') {
          this.isChildUpdate1 = false
          this.isChildUpdate2 = true
        }
      }

    }
  };
</script>
<style>
  .priceAdjust {
  padding-left:15px;
  }
</style>

