部署到netlify上暗黑主题刷新页面无法加载相应样式
dengsong666 opened this issue · comments
dengsong commented
Describe the bug
我尝试在Nuxt3上使用naiveui,我查看样式,他没有加载对应的dark样式,这是我的主要代码,我哪里配置有问题吗?
const isDark = useCookie<boolean>('dark')
const naiveUITheme = computed(() => (isDark.value || route.path == '/about') ? darkTheme : null)
<n-config-provider inline-theme-disabled :theme="naiveUITheme" :locale="zhCN" :date-locale="dateZhCN"><slot /></n-config-provider>
Steps to reproduce
当我点击切换主题的图标时,或者刷新页面它在本地测试都是正常的,但部署到netlify上,点击切换也正常,不过刷新就不正常了
本地正常
线上不正常
打印出的主题变量name是dark,正常的
Link to minimal reproduction
https://blog.dengsong.asia/article
System Info
System:
OS: Windows 11 10.0.22631
CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400
Memory: 12.84 GB / 31.75 GB
Binaries:
Node: 18.17.0 - D:\Env\Node\nodejs\node.EXE
Yarn: 1.22.22 - D:\Env\Node\nodejs\yarn.CMD
npm: 9.6.7 - D:\Env\Node\nodejs\npm.CMD
pnpm: 8.15.5 - D:\Env\Node\nodejs\pnpm.CMD
Browsers:
Edge: Chromium (123.0.2420.97)
Internet Explorer: 11.0.22621.3527
npmPackages:
naive-ui: ^2.38.2 => 2.38.2
vue: ^3.4.27 => 3.4.27
Used Package Manager
pnpm
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
dengsong commented
ssr的问题,用ClientOnly包裹又行了,这是nuxt3的问题还是naive ui的问题啊?
dengsong commented
ssr的问题,用ClientOnly包裹又行了,这是nuxt3的问题还是naive ui的问题啊?
应该是naive ui ssr的问题,有时间再研究看看,哎
jahnli commented
jahnli commented
This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem