-
First of all, thank you very much for your open source project! I am new in frontend, and I want to use this is my code, and preview doc link: https://cs.hrh.icu/cs/intro <script setup>
import Giscus from '@giscus/vue'
import DefaultTheme from 'vitepress/theme'
import { useData } from 'vitepress'
const { isDark } = useData()
const { Layout } = DefaultTheme
</script>
<template>
<Layout>
<template #doc-after>
<div id="giscus" :key="isDark">
<Giscus ... lang="zh-CN" loading="lazy" :theme="[isDark ? 'transparent_dark' : 'light_tritanopia']" />
</div>
</template>
</Layout>
</template>
<style scoped>
#giscus {
margin-top: 3.2rem;
}
</style> |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You shouldn't need to use |
Beta Was this translation helpful? Give feedback.
-
You need to use |
Beta Was this translation helpful? Give feedback.
You need to use
computed
for your use case, because thetheme
is computed fromisDark
. Withoutcomputed
, the value is only calculated on initial render.Fix: https://github.com/mancuoj/csdiy/pull/20