fix: window on ssr error + cors problem with launcher meta (#5856)

This commit is contained in:
Calum H.
2026-04-19 00:55:57 +01:00
committed by GitHub
parent 9b3fe6390e
commit 065759d1b8
4 changed files with 41 additions and 5 deletions

View File

@@ -1,13 +1,20 @@
<!-- eslint-disable eslint-comments/require-description -->
<script setup>
import dayjs from 'dayjs'
import { defineAsyncComponent, ref } from 'vue'
import { defineAsyncComponent, onMounted, ref } from 'vue'
import { useFormatNumber } from '../../composables/index.ts'
import Card from '../base/Card.vue'
const VueApexCharts = defineAsyncComponent(() => import('vue3-apexcharts'))
// apexcharts touches `window` at module load time, so we must not let SSR
// resolve the async component. Render only after mount on the client.
const isClient = ref(false)
onMounted(() => {
isClient.value = true
})
const formatNumber = useFormatNumber()
const props = defineProps({
@@ -148,6 +155,7 @@ const chartOptions = ref({
{{ title }}
</div>
<VueApexCharts
v-if="isClient"
ref="chart"
type="area"
height="120"