vue3-calendar-heatmap
vue3-calendar-heatmap copied to clipboard
Cannot read properties of undefined (reading 'weekCount')
<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,
},
]
fixed :) ✅
<calendar-heatmap
:values="values.values"
:end-date="values.endDate"
:tooltip-unit="values.picked" />
but vscode Type 'unknown[]' is not assignable to type 'Value[]'.
