<template>
  <div class="form-wrap">
    <el-tabs v-model="activeTab">
      <el-tab-pane label="订单列表" name="list">
        <OrderList />
      </el-tab-pane>
      <el-tab-pane label="订单统计" name="statistics">
        <OrderStatistics v-if="tabLoaded.statistics" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import OrderList from './order/OrderList'
import OrderStatistics from './order/OrderStatistics'

export default {
  components: {
    OrderList,
    OrderStatistics
  },
  data () {
    return {
      activeTab: 'list',
      tabLoaded: {
        list: true,
        statistics: false
      }
    }
  },
  watch: {
    activeTab (val) {
      this.tabLoaded[val] = true
    }
  }
}
</script>

<style scoped>

</style>
