vue3-calendar-heatmap icon indicating copy to clipboard operation
vue3-calendar-heatmap copied to clipboard

Cannot read properties of undefined (reading 'weekCount')

Open productdevbook opened this issue 3 years ago • 1 comments

<template>
  <div>
    <calendar-heatmap
      :values="values"
      :end-date="values.endDate"
      :tooltip-unit="values.picked" />
  </div>
</template>

<script lang="ts">
  import {computed, defineComponent} from 'vue'
  import {CalendarHeatmap} from 'vue3-calendar-heatmap'

  export default defineComponent({
    components: {
      CalendarHeatmap,
    },
    props: {
      data: {
        type: Array,
        default: () => [
          {
            date: '2018-09-28',
            count: 1,
          },
        ],
      },
    },
    setup(props) {
      const values = computed(() => {
        return {
          values: props.data,
          endDate: new Date('2021-08-01'),
          picked: 'Dings',
        }
      })

      return {
        values,
      }
    },
  })
</script>

props data send

const dataExample = [
  {
    date: '2020-11-30T23:00:00Z',
    count: 635000,
  },
  {
    date: '2020-12-02T23:00:00Z',
    count: 2442000,
  },
]

productdevbook avatar Dec 01 '21 04:12 productdevbook

fixed :) ✅

<calendar-heatmap
      :values="values.values"
      :end-date="values.endDate"
      :tooltip-unit="values.picked" />

but vscode Type 'unknown[]' is not assignable to type 'Value[]'.

CleanShot 2021-12-01 at 07 06 54@2x

productdevbook avatar Dec 01 '21 04:12 productdevbook