fix (client): MkActiveUsersHeatmap does not take props

This commit is contained in:
naskya 2024-02-28 02:16:01 +09:00
parent e0447ba4a9
commit 8f0cccac7d
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -8,7 +8,7 @@
</template>
<script lang="ts" setup>
import { nextTick, onMounted, ref, shallowRef, watch } from "vue";
import { nextTick, onMounted, ref, shallowRef } from "vue";
import { Chart } from "chart.js";
import * as os from "@/os";
import { defaultStore } from "@/store";
@ -18,12 +18,8 @@ import { initChart } from "@/scripts/init-chart";
initChart();
const props = defineProps<{
src: string;
}>();
const rootEl = shallowRef<HTMLDivElement>(null);
const chartEl = shallowRef<HTMLCanvasElement>(null);
const rootEl = shallowRef<HTMLDivElement>();
const chartEl = shallowRef<HTMLCanvasElement>();
const now = new Date();
let chartInstance: Chart | null = null;
const fetching = ref(true);
@ -203,14 +199,6 @@ async function renderActiveUsersChart() {
});
}
watch(
() => props.src,
() => {
fetching.value = true;
renderActiveUsersChart();
},
);
onMounted(async () => {
renderActiveUsersChart();
});