store.vue 695 Bytes
<template>
  <div>
    <div class="title title-icon">
      <span class="icon"></span>
      <span>门店类型</span>
    </div>
    <div class="container flex">
      <pie-chart :id="chart.id" :list="storeData" :keys="chart.keys"></pie-chart>
      <Legend :list="storeData" :colors="chart.colors"></Legend>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Store',
  data() {
    return {
      chart: {
        id: 'store',
        keys: ['name', 'num'],
        colors: ['#4FA0FF', '#7CFFB2', '#FDF006', '#EB6001']
      },
      storeData: []
    }
  },
  created() {
    this.$bus.$on('clientData', data => {
      this.storeData = data.storeData
    })
  }
}
</script>