<template>
  <el-empty :image-size="80" v-if="isSeriesEmpty" description="暂无数据"></el-empty>
  <pie-chart v-else v-bind="$props" />
</template>

<script>
import { isEmpty } from 'lodash';
import PieChart from './PieChart.vue';

export default {
  name: 'EchartPie',
  components: { PieChart },
  props: PieChart.props,
  computed: {
    // 针对饼图数据是不是无效的判断
    isSeriesEmpty() {
      return isEmpty(this.seriesData);
    }
  }
};
</script>
