Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部署到netlify上暗黑主题刷新页面无法加载相应样式 #5944

Closed
5 tasks done
dengsong666 opened this issue May 13, 2024 · 4 comments
Closed
5 tasks done
Labels
untriaged need to sort

Comments

@dengsong666
Copy link

dengsong666 commented May 13, 2024

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,正常的
image

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

@dengsong666 dengsong666 added the untriaged need to sort label May 13, 2024
@dengsong666 dengsong666 changed the title 暗黑主题刷新页面无法加载相应样式 部署到netlify上暗黑主题刷新页面无法加载相应样式 May 13, 2024
@dengsong666
Copy link
Author

ssr的问题,用ClientOnly包裹又行了,这是nuxt3的问题还是naive ui的问题啊?

@dengsong666
Copy link
Author

ssr的问题,用ClientOnly包裹又行了,这是nuxt3的问题还是naive ui的问题啊?

应该是naive ui ssr的问题,有时间再研究看看,哎

@jahnli
Copy link
Collaborator

jahnli commented May 15, 2024

@jahnli
Copy link
Collaborator

jahnli commented May 17, 2024

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

@jahnli jahnli closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
Development

No branches or pull requests

2 participants