index.vue 474 B

123456789101112131415161718192021
  1. <template>
  2. <el-empty :image-size="80" v-if="isSeriesEmpty" description="暂无数据"></el-empty>
  3. <pie-chart v-else v-bind="$props" />
  4. </template>
  5. <script>
  6. import { isEmpty } from 'lodash';
  7. import PieChart from './PieChart.vue';
  8. export default {
  9. name: 'EchartPie',
  10. components: { PieChart },
  11. props: PieChart.props,
  12. computed: {
  13. // 针对饼图数据是不是无效的判断
  14. isSeriesEmpty() {
  15. return isEmpty(this.seriesData);
  16. }
  17. }
  18. };
  19. </script>