Skip to content

Conversation

@LoTwT
Copy link
Contributor

@LoTwT LoTwT commented Apr 15, 2025

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The previous setter logic of isDark doesn't match the click event @click="isDark = !isDark". The writable computed needs a new value.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 15, 2025

npm i https://pkg.pr.new/@nuxt/ui@3903

commit: 74bcdf6

@benjamincanac benjamincanac added the v3 #1289 label Apr 16, 2025
@benjamincanac
Copy link
Member

Not sure to understand the issue here, what is it you're trying to fix?

@LoTwT
Copy link
Contributor Author

LoTwT commented Apr 17, 2025

The original logic works, but it's not right.

isDark is a writable computed. The @click="isDark = !isDark" is to assign a new value to isDark. So the setter should receive a new value to update related variables.

image

@benjamincanac benjamincanac changed the title docs: fix the setter logic of isDark in ColorModeButton.vue docs(color-mode): fix the setter in ColorModeButton.vue example Apr 17, 2025
@benjamincanac benjamincanac changed the title docs(color-mode): fix the setter in ColorModeButton.vue example docs(color-mode): fix computed setter logic in ColorModeButton.vue example Apr 17, 2025
@benjamincanac
Copy link
Member

benjamincanac commented Apr 17, 2025

Oh yes you're absolutely correct! Would you mind applying the same change in playground/app/app.vue?

Copy link
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 😊

@benjamincanac benjamincanac merged commit 8ea99f0 into nuxt:v3 Apr 17, 2025
5 checks passed
@LoTwT LoTwT deleted the docs-color-mode branch April 17, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 #1289

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants