|
76 | 76 |
|
77 | 77 | <script lang="ts">
|
78 | 78 | import { defineComponent, onBeforeUnmount, onMounted, PropType, ref, toRefs, watch } from 'vue';
|
79 |
| - import { Heatmap, CalendarItem, Locale, Month, Position, Value } from '@/Heatmap'; |
| 79 | + import { CalendarItem, Heatmap, Locale, Month, Position, Value } from '@/Heatmap'; |
80 | 80 | import tippy, { createSingleton, CreateSingletonInstance, Instance } from 'tippy.js';
|
81 | 81 | import 'tippy.js/dist/tippy.css';
|
82 | 82 | import 'tippy.js/dist/svg-arrow.css';
|
|
249 | 249 | }
|
250 | 250 | }
|
251 | 251 |
|
252 |
| - watch(toRefs(props).values, () => { |
253 |
| - heatmap.value = new Heatmap(props.endDate as Date, props.values, props.max); |
254 |
| - tippyInstances?.map(i => i.destroy()); |
255 |
| - initTippy(); |
256 |
| - }); |
| 252 | +
|
| 253 | + const { values, tooltipUnit, tooltipFormatter, noDataText, max, rangeColor } = toRefs(props); |
| 254 | + watch( |
| 255 | + [ values, tooltipUnit, tooltipFormatter, noDataText, max, rangeColor ], |
| 256 | + () => { |
| 257 | + heatmap.value = new Heatmap(props.endDate as Date, props.values, props.max); |
| 258 | + tippyInstances?.map(i => i.destroy()); |
| 259 | + initTippy(); |
| 260 | + } |
| 261 | + ); |
257 | 262 |
|
258 | 263 | onMounted(initTippy);
|
259 | 264 | onBeforeUnmount(() => {
|
|
0 commit comments